mardaa.blogg.se

Active directory for users and computers
Active directory for users and computers







ObjConn.Close Creating and linking a Group Policy Object (GPO)

active directory for users and computers

' If the user was found the computername will be stored in the street attribute. Set objRS = objConn.Execute (strDefaultNamingContext &" (sAMAccountName="&strUserID&") sAMAccountName,ADsPath SubTree") ' Searching User object in Active Directory and initiating an ojbect ObjConn.Properties("ADSI Flag") = ADS_SECURE_AUTHENTICATION + ADS_USE_SEALING + ADS_USE_SIGNING + ADS_FAST_BIND Set objConn = CreateObject("ADODB.Connection") ' Binding to Active Directory using ADO (+Kerberos) StrComputerName = objWShell.ExpandEnvironmentStrings("%COMPUTERNAME%")

active directory for users and computers

StrUserID = objWShell.ExpandEnvironmentStrings("%USERNAME%") ' Get username and computername from the environment variables Set objWShell = CreateObject("WScript.Shell") ' Authenticating against active directory with Kerberosĭim objDSE, objConn, objRS, objdso, objADSUser, objWShell, strDefaultNamingContext, strADSUser, strComputerName ' to redistribute it under certain conditions see gnu-gpl for details. This is free software, and you are welcome ' This VB script comes with ABSOLUTELY NO WARRANTY for details

active directory for users and computers

' Sets the "street" attribute to the computer name Open Notepad or another text editor of your choice and place the following lines of code into it. VBScript to store the computer name in the user object Permitting SELF to change the street attributeĬonfirm all open windows by clicking OK and close ADUC.









Active directory for users and computers