Showing posts with label Windows. Show all posts
Showing posts with label Windows. Show all posts

Saturday, May 14, 2016

Hard Code DNS Servers with PowerShell

 on  with No comments 
In , ,  
The following is a PowerShell script to quickly hard code DNS servers for every network interface present on a computer. It will overwrite the existing DNS servers configured on that machines interfaces.  In this example, we'll be using the IP addresses for OpenDNS servers.

# The servers that we want to use
$newDNSServers = "208.67.220.220","208.67.222.222"

# Get all network adapters that already have DNS servers set
$adapters = Get-WmiObject Win32_NetworkAdapterConfiguration | Where-Object {$_.DNSServerSearchOrder -ne $null}

# Set the DNS server search order for all of the previously-found adapters
$adapters | ForEach-Object {$_.SetDNSServerSearchOrder($newDNSServers)}
Share:

Saturday, January 23, 2016

Generating Test Users

 on  with No comments 
In , ,  
In setting up an Active Directory environment, you often need test users that are part of test groups and test Organizational Units. In a post at TechExams, Slowhand presents a script that will take a csv file containing names and departments of some dummy users, then creates an OU structure based on a couple of questions.  The users will be created based on the names in the file, and each user will be added into a group with the name of their department.  

Because I always subscribe to the theory of overkill, I used this site to generate a much longer list of names.  Tell it to generate 50 names, and then once they are generated, scroll down to the bottom and click List in text area, then you can copy/paste them out into a text file.  Run it as many times as you wish to generate longer lists. Don't forget to replace the space in between the first and last name with a comma, and then add another comma after the last name, followed by a department. They can all be the same department if you don't care to separate them.

Somehow this post was eaten, so I've rewritten it.
Share:

Friday, May 8, 2015

Hyper-V replication across the WAN

 on  with No comments 
In ,  
I've recently been working on Hyper-V replication across the Internet to give our clients the option of maintaining an offsite copy of their server in our data center. Everything was going smoothly up to a point. I set up a site-to-site VPN connection between them and us, built an Active Directory two way trust between their domain and ours, and then tried to enter their Hyper-V host into our System Center Virtual Machine Manager system.  This is where I ran into a road block.
Share:

Thursday, April 30, 2015

Workstation Unable to Join Domain

 on  with No comments 
In ,  
I had a computer that would not join a domain. No matter what I tried, it would come back with "The following error has occurred when trying to join the "abcdefg.com" domain: network path not found."  I tried just about everything I came across while searching on Google:
  • Disable Windows Firewall
  • Run ipconfig /registerdns
  • Run dcdiag on the domain controller
  • Verify FSMO roles of the domain controller
  • Verify reverse lookup zone in DNS
  • Ping domain.com 
  • Verify _ldap._tcp.dc._mscds.domain.com in DNS
Share: