If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.
Const wbemFlagReturnImmediately = &h10 Const wbemFlagForwardOnly = &h20 arrComputers = Array(".") For Each strComputer In arrComputers WScript.Echo WScript.Echo "==========================================" WScript.Echo "Computer: " & strComputer WScript.Echo "==========================================" Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2\NV") Set colItems = objWMIService.ExecQuery("SELECT * FROM SyncTopology", "WQL", _ wbemFlagReturnImmediately + wbemFlagForwardOnly) For Each objItem In colItems NodeID = objItem.id WScript.Echo "id: " & NodeID WScript.Echo Next Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2\NV") Set SyncClass = objWMIService.Get("Sync") if (SyncClass.toggleSource()) Then wscript.echo "done!" End if Next
if (SyncClass.toggleSource()) Then
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
|VB script for outlook to copy mail to OneNote||2||41|
|How to export members from Domain Local Security group ?||10||44|
|Copy-Item, Move-Item, Test-Path and locking the file until complete||2||45|
|Export list of Exchange Online user's Photo||4||46|
Join the community of 500,000 technology professionals and ask your questions.