ADsDSOObject

The Active Directory Services Data Services Objects "ADSDSO" is a collection of COM objects that serves as an OLEDB data provider when connecting to Active Directory Services. Below are some practical VbScripts that use ADSDSO to help you when trying to automate functions within your Active Directory.

VbScript that use ADsDSOObject

... CreateObject (" ADODB.Connection ") Set objCommand = CreateObject (" ADODB.Command ") objConnection.Provider =" ADsDSOObject" objConnection.Open" Active Directory Provider" Set objCOmmand.ActiveConnection = objConnection objCommand.CommandText =_" Select ...
 

 
... CreateObject (" ADODB.Connection ") Set objCommand = CreateObject (" ADODB.Command ") objConnection.Provider =" ADsDSOObject" objConnection.Open" Active Directory Provider" Set objCommand.ActiveConnection = objConnection objCommand.CommandText =_" Select ...
 

 
... Next End If Set objConnection = CreateObject (" ADODB.Connection ") objConnection.Open" Provider = ADsDSOObject ;" Set objCommand = CreateObject (" ADODB.Command ") objCommand.ActiveConnection = objConnection objCommand.CommandText =_" ;( ...
 

 
... (" primaryGroupID ") Set objConnection = CreateObject (" ADODB.Connection ") objConnection.Open" Provider = ADsDSOObject ;" Set objCommand = CreateObject (" ADODB.Command ") objCommand.ActiveConnection = objConnection objCommand.CommandText =_" ;( ...
 

 
... objContainer.SetInfo Function GetGPOADsPath Set objConnection = CreateObject (" ADODB.Connection ") objConnection.Open" Provider = ADsDSOObject ;" Set objCommand = CreateObject (" ADODB.Command ") objCommand.ActiveConnection = objConnection objCommand.CommandText =_" ;;" ...
 

 
... If Function GetGPOName Set objConnection = CreateObject (" ADODB.Connection ") objConnection.Open" Provider = ADsDSOObject ;" Set objCommand = CreateObject (" ADODB.Command ") objCommand.ActiveConnection = objConnection objCommand.CommandText =_" ;;" ...
 

 
... CreateObject (" ADODB.Connection ") Set objCommand = CreateObject (" ADODB.Command ") objConnection.Provider =" ADsDSOObject" objConnection.Open" Active Directory Provider" Set objCOmmand.ActiveConnection = objConnection objCommand.CommandText =_" Select ...
 

 
... (Now ()) Set objConnection = CreateObject (" ADODB.Connection ") objConnection.Open" Provider = ADsDSOObject ;" Set objCommand = CreateObject (" ADODB.Command ") objCommand.ActiveConnection = objConnection objCommand.CommandText =_" ;(&( ...
 

 
... ADS_UF_ACCOUNTDISABLE = 2 Set objConnection = CreateObject (" ADODB.Connection ") objConnection.Open" Provider = ADsDSOObject ;" Set objCommand = CreateObject (" ADODB.Command ") objCommand.ActiveConnection = objConnection objCommand.CommandText =_" ;( ...
 

 
... CreateObject (" ADODB.Connection ") Set objCommand = CreateObject (" ADODB.Command ") objConnection.Provider =" ADsDSOObject" objConnection.Open" Active Directory Provider" Set objCommand.ActiveConnection = objConnection objCommand.Properties (" Page Size ") ...
 

 
... CreateObject (" ADODB.Connection ") Set objCommand = CreateObject (" ADODB.Command ") objConnection.Provider =" ADsDSOObject" objConnection.Open" Active Directory Provider" Set objCommand.ActiveConnection = objConnection objCommand.CommandText =" Select printerName ...
 

 
... CreateObject (" ADODB.Connection ") Set objCommand = CreateObject (" ADODB.Command ") objConnection.Provider =" ADsDSOObject" objConnection.Open" Active Directory Provider" Set objCOmmand.ActiveConnection = objConnection objCommand.CommandText =" Select printerName ...
 

 
... Platforms VBScript Code Set objConnection = CreateObject (" ADODB.Connection ") objConnection.Open" Provider = ADsDSOObject ;" Set objCommand = CreateObject (" ADODB.Command ") objCommand.ActiveConnection = objConnection objCommand.CommandText =_" ;" ...
 

 
... Platforms VBScript Code Set objConnection = CreateObject (" ADODB.Connection ") objConnection.Open" Provider = ADsDSOObject ;" Set objCommand = CreateObject (" ADODB.Command ") objCommand.ActiveConnection = objConnection objCommand.CommandText =_" ;" ...
 

 
... IS_INDEXED = 1 Set objConnection = CreateObject (" ADODB.Connection ") objConnection.Open" Provider = ADsDSOObject ;" Set objCommand = CreateObject (" ADODB.Command ") objCommand.ActiveConnection = objConnection objCommand.Properties (" Sort On ") ...
 

 
... CreateObject (" ADODB.Connection ") Set objCommand = CreateObject (" ADODB.Command ") objConnection.Provider =" ADsDSOObject" objConnection.Open" Active Directory Provider" Set objCommand.ActiveConnection = objConnection objCommand.CommandText =_" SELECT ...
 

 
... CreateObject (" ADODB.Connection ") Set objCommand = CreateObject (" ADODB.Command ") objConnection.Provider =" ADsDSOObject" objConnection.Open" Active Directory Provider" Set objCommand.ActiveConnection = objConnection objCommand.CommandText =_" SELECT ...
 

 
... CreateObject (" ADODB.Connection ") Set objCommand = CreateObject (" ADODB.Command ") objConnection.Provider = (" ADsDSOObject ") objConnection.Open" Active Directory Provider" objCommand.ActiveConnection = objConnection objCommand.CommandText =" SELECT samAccountName FROM ...
 

 
... CreateObject (" ADODB.Connection ") Set objCommand = CreateObject (" ADODB.Command ") objConnection.Provider =" ADsDSOObject" objConnection.Properties (" User ID ") =" Administrator" objConnection.Properties (" Password ") = "+ ...
 

 
... CreateObject (" ADODB.Connection ") Set objCommand = CreateObject (" ADODB.Command ") objConnection.Provider =" ADsDSOObject" objConnection.Open" Active Directory Provider" Set objCommand.ActiveConnection = objConnection objCommand.Properties (" Page Size ") ...
 

 
... CreateObject (" ADODB.Connection ") Set objCommand = CreateObject (" ADODB.Command ") objConnection.Provider =" ADsDSOObject" objConnection.Open" Active Directory Provider" Set objCommand.ActiveConnection = objConnection objCommand.Properties (" Page Size ") ...
 

 
... CreateObject (" ADODB.Connection ") Set objCommand = CreateObject (" ADODB.Command ") objConnection.Provider =" ADsDSOObject" objConnection.Open" Active Directory Provider" Set objCommand.ActiveConnection = objConnection objCommand.Properties (" Page Size ") ...
 

 
... ADS_SCOPE_SUBTREE = 2 Set objConnection = CreateObject (" ADODB.Connection ") objConnection.Open" Provider = ADsDSOObject ;" Set objCommand = CreateObject (" ADODB.Command ") objCommand.ActiveConnection = objConnection objCommand.Properties (" Searchscope ") = ...
 

 
... CreateObject (" ADODB.Connection ") Set objCommand = CreateObject (" ADODB.Command ") objConnection.Provider =" ADsDSOObject" objConnection.Open" Active Directory Provider" Set objCommand.ActiveConnection = objConnection objCommand.Properties (" Page Size ") ...
 

 
... CreateObject (" ADODB.Connection ") Set objCommand = CreateObject (" ADODB.Command ") objConnection.Provider =" ADsDSOObject" objConnection.Open" Active Directory Provider" Set objCommand.ActiveConnection = objConnection objCommand.Properties (" Page Size ") ...
 

 
... CreateObject (" ADODB.Connection ") Set objCommand = CreateObject (" ADODB.Command ") objConnection.Provider =" ADsDSOObject" objConnection.Open" Active Directory Provider" Set objCommand.ActiveConnection = objConnection objCommand.Properties (" Page Size ") ...
 

 
... CreateObject (" ADODB.Connection ") Set objCommand = CreateObject (" ADODB.Command ") objConnection.Provider =" ADsDSOObject" objConnection.Open" Active Directory Provider" Set objCommand.ActiveConnection = objConnection objCommand.Properties (" Page Size ") ...
 

 
... CreateObject (" ADODB.Connection ") Set objCommand = CreateObject (" ADODB.Command ") objConnection.Provider =" ADsDSOObject" objConnection.Open" Active Directory Provider" Set objCommand.ActiveConnection = objConnection objCommand.Properties (" Page Size ") ...
 

 
... CreateObject (" ADODB.Connection ") Set objCommand = CreateObject (" ADODB.Command ") objConnection.Provider = (" ADsDSOObject ") objConnection.Open" Active Directory Provider" objCommand.ActiveConnection = objConnection objCommand.Properties (" Page Size ") = ...
 

 
... CreateObject (" ADODB.Connection ") Set objCommand = CreateObject (" ADODB.Command ") objConnection.Provider =" ADsDSOObject" objConnection.Open" Active Directory Provider" Set objCommand.ActiveConnection = objConnection objCommand.Properties (" Page Size ") ...
 

 
... CreateObject (" ADODB.Connection ") Set objCommand = CreateObject (" ADODB.Command ") objConnection.Provider =" ADsDSOObject" objConnection.Open" Active Directory Provider" Set objCommand.ActiveConnection = objConnection objCommand.Properties (" Page Size ") ...
 

 
... CreateObject (" ADODB.Connection ") Set objCommand = CreateObject (" ADODB.Command ") objConnection.Provider =" ADsDSOObject" objConnection.Open" Active Directory Provider" Set objCommand.ActiveConnection = objConnection objCommand.Properties (" Page Size ") ...
 

 
... CreateObject (" ADODB.Connection ") Set objCommand = CreateObject (" ADODB.Command ") objConnection.Provider =" ADsDSOObject" objConnection.Open" Active Directory Provider" Set objCommand.ActiveConnection = objConnection objCommand.Properties (" Page Size ") ...
 

 
... CreateObject (" ADODB.Connection ") Set objCommand = CreateObject (" ADODB.Command ") objConnection.Provider =" ADsDSOObject" objConnection.Open" Active Directory Provider" Set objCommand.ActiveConnection = objConnection objCommand.Properties (" Page Size ") ...
 

 
... CreateObject (" ADODB.Connection ") Set objCommand = CreateObject (" ADODB.Command ") objConnection.Provider =" ADsDSOObject" objConnection.Open" Active Directory Provider" Set objCommand.ActiveConnection = objConnection objCommand.Properties (" Page Size ") ...
 

 
... CreateObject (" ADODB.Connection ") Set objCommand = CreateObject (" ADODB.Command ") objConnection.Provider =" ADsDSOObject" objConnection.Open" Active Directory Provider" Set objCommand.ActiveConnection = objConnection objCommand.Properties (" Page Size ") ...
 

 
... CreateObject (" ADODB.Connection ") Set objCommand = CreateObject (" ADODB.Command ") objConnection.Provider =" ADsDSOObject" objConnection.Open" Active Directory Provider" Set objCommand.ActiveConnection = objConnection objCommand.Properties (" Page Size ") ...
 

 
... CreateObject (" ADODB.Connection ") Set objCommand = CreateObject (" ADODB.Command ") objConnection.Provider =" ADsDSOObject" objConnection.Open" Active Directory Provider" Set objCommand.ActiveConnection = objConnection objCommand.Properties (" Page Size ") ...
 

 
... CreateObject (" ADODB.Connection ") Set objCommand = CreateObject (" ADODB.Command ") objConnection.Provider =" ADsDSOObject" objConnection.Open" Active Directory Provider" Set objCommand.ActiveConnection = objConnection objCommand.Properties (" Page Size ") ...
 

 
... CreateObject (" ADODB.Connection ") Set objCommand = CreateObject (" ADODB.Command ") objConnection.Provider =" ADsDSOObject" objConnection.Open" Active Directory Provider" Set objCommand.ActiveConnection = objConnection objCommand.Properties (" Page Size ") ...
 

 
... CreateObject (" ADODB.Connection ") Set objCommand = CreateObject (" ADODB.Command ") objConnection.Provider =" ADsDSOObject" objConnection.Open" Active Directory Provider" Set objCommand.ActiveConnection = objConnection objCommand.CommandText =" Select Name ...
 

 
... CreateObject (" ADODB.Connection ") Set objCommand = CreateObject (" ADODB.Command ") objConnection.Provider =" ADsDSOObject" objConnection.Open" Active Directory Provider" Set objCOmmand.ActiveConnection = objConnection objCommand.CommandText =" Select Name ...