![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | How to list offline Domain Controllers Hello all, I have written the below script to scan through the Domain Controllers Ou and set the WINS to address listed. At the moment the script will only return the name and IP addresses of Servers that are currently onilne. My question is, how can I get the script to also return atleast server name with message (Computer Offline) for servers that are not reachable. #get the .Net Directory Class [void] [reflection.assembly]::LoadWithPartialName("System.DirectoryServices.ActiveDirectory.Domain.Class") #Get All computers from domain controllers OU $OU=[ADSI]"LDAP://OU=Domain Controllers,DC=domainname,DC=ORG" #Filter only computer objects from this OU ForEach($child in $OU.psbase.children) { If ($child.objectcategory -like '*computer*') { ForEach($computer in $child.name) { #If NIC is Enabled and have a static IP address, set WinServer Get-WmiObject win32_networkadapterconfiguration -ComputerName $computer| Where-Object {$_.IPEnabled -eq 'true'} |ForEach- Object{ $computer;$_.IPAddress; $_.SetWinsServer("192.168.10.150","192.168.10.250")} } } } |
My System Specs![]() |
| | #2 (permalink) |
| | Re: How to list offline Domain Controllers Hi Isaac, Your question has been answered here: http://www.powergui.org/thread.jspa?messageID=22857 --- Shay Levy Windows PowerShell MVP http://blogs.microsoft.co.il/blogs/ScriptFanatic PowerShell Toolbar: http://tinyurl.com/PSToolbar I> Hello all, I> I have written the below script to scan through the Domain I> Controllers I> Ou and set the WINS to address listed. At the moment the script will I> only return the name and IP addresses of Servers that are currently I> onilne. My question is, how can I get the script to also return I> atleast server name with message (Computer Offline) for servers that I> are not reachable. I> #get the .Net Directory Class I> [void] I> [reflection.assembly]::LoadWithPartialName("System.DirectoryServices. I> ActiveDirectory.Domain.Class") I> #Get All computers from domain controllers OU I> I> $OU=[ADSI]"LDAP://OU=Domain Controllers,DC=domainname,DC=ORG" I> I> #Filter only computer objects from this OU I> I> ForEach($child in $OU.psbase.children) I> { I> If ($child.objectcategory -like '*computer*') I> { I> ForEach($computer in $child.name) I> { I> #If NIC is Enabled and have a static IP address, set WinServer I> Get-WmiObject win32_networkadapterconfiguration -ComputerName I> $computer| Where-Object {$_.IPEnabled -eq 'true'} |ForEach- I> Object{ $computer;$_.IPAddress; I> $_.SetWinsServer("192.168.10.150","192.168.10.250")} I> } I> } I> } |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Re: Scripted removal of domain controllers from AD? | PowerShell | |||
| Scripted removal of domain controllers from AD? | PowerShell | |||
| domain controllers - up / down | PowerShell | |||
| Looking for domain controllers | PowerShell | |||
| Domain Controllers | Vista account administration | |||