i m just change the domain name on the script and excute it and the follwoing error had shown lin :10 char:1 error:table does not exist code:80040e37 source: provider
If im using this exact script to find all disabled user accounts, how do I redirect it to a text file? Please kindly advice. Cheers! DB
REM call this script with REM cscript scriptname.vbs Const ADS_UF_ACCOUNTDISABLE = 2 Set objStdOut = WScript.StdOut Set objConnection = CreateObject("A DODB.Connection ") objConnection.O pen "Provider=ADsDS OObject;" Set objCommand = CreateObject("A DODB.Command") objCommand.Acti veConnection = objConnection objCommand.Comm andText = "<GC://dc=domai nname,dc=countr y>;(objectCateg ory=UserTest)"
Hello Guys, " ....how do I redirect it to a text file?" Voila ;-) On Error Resume Next Const ADS_SCOPE_SUBTREE = 2 Set objConnection = CreateObject("A DODB.Connection ") Set objCommand = CreateObject("A DODB.Command") objConnection.P rovider = "ADsDSOObject" objConnection.O pen "Active Directory Provider" Set objCommand.Acti veConnection = objConnection objCommand.Prop erties("Page Size") = 1000 objCommand.Prop erties("Searchs cope") = ADS_SCOPE_SUBTR EE objCommand.Comm andText = _ "<LDAP://dc=bre -ls,dc=de>;(&(o bjectCategory=U ser)" & _ "(userAccountCo ntrol:1.2.840.1 13556.1.4.803:= 2));Name;Subtre e" Set objRecordSet = objCommand.Exec ute FileName = "AD_Deaktiviert e_Benutzer.txt" Set FS = CreateObject("S cripting.FileSy stemObject") Set LogFile = FS.OpenTextFile (FileName , 2, True) objRecordSet.Mo veFirst Do Until objRecordSet.EO F LogFile.WriteLi ne objRecordSet.Fi elds("Name").Va lue objRecordSet.Mo veNext Loop LogFile.Close
Can you explain the IF test line? intUAC is an even value and ADS_UF_ACCOUNTDISABLE is a constant, so when is this test true/false and why? The userAccountCont rol value is a sum value of different constants, so I'm trying to understand the test and why it is true or false.