This problem was bugging me for a while now. Every time I have to connect to a different DC, status for one of them is showing as “Unavailable” In my case this hasn’t got anything to do with the domain controller actually functioning or having connectivity. DC works fine and I haven’t had any problems with it.
Few screenshots demonstrating the issue as well as explaining what’s the cause:
One very useful piece of information to know, if you’re working in large Active Directory implementation with multiple DC’s and Sites, is to be able to determine which Domain Controller machines are authenticating against at any given time.
Here’s the command to tell us exactly that:
Rather handy if you’re testing whether Sites and Services have been setup correctly or are moving computer objects in Active Directory and want the quickest turnaround for GPO’s etc.
You could always use built-in ‘set l’ command but that’s not always accurate due to %logonserver% variable taking a bit of time to update if you change Active Directory site and ultimately domain controller you’re authentication against. Remote workers are good example as they tend to be all over the place and ‘set l’ might give misleading and not precise results.
The only change you have to make for this script to work is to provide an LDAP string/path to the OU in AD where you’d like to shut the PCs.
In my company we had to come up with a solution to comply with the “green” policy enforced upon us. Initially I have tried the built-in shutdown command and feeding in computer names using Excel and CONCATENATE function. Issue with that approach was that my script was trying to reach out to each machine to check if its on the network and pingable taking too long to complete. Script above doesn’t have the same issues – it literally fires up shutdown request simultaneously to all machines on the specified OU – much quicker and definitely more effective!
If you guys have other ideas or have other solutions please let me know in comments below!