Search the Community
Showing results for tags 'OU'.
-
I have been working on this for days with no luck. I am working on a script to move laptops into the proper OU specified by $sTargetOU while the computer name is $sObject The situation: IT people are logged onto laptops using the end user account (to profile them) which apparently does not have permissions to move computer accounts in AD from one OU to another. The other situation: When I profile a new laptop for a user, I am logged in as local admin and try to use a script to move the computer into a specified OU. I have credentials that I can use to move the computer account, but I would like to package this into an autoit script. I currently use AD.au3, which does the job as long as I am logged in with an IT AD account with sysadmin abilities. What I am looking to do: Simple one stop shop application that lets me runas a function similar to that below: _AD_Open() Global $iValue = _AD_MoveObject($sTargetOU, $sObject & "$") If $iValue = 1 Then MsgBox(64, "Active Directory Message", "Computer '" & $sObject & "' successfully moved to '" & $sTargetOU & "'") ElseIf @error = 1 Then MsgBox(64, "Active Directory Message", "Target OU '" & $sTargetOU & "' does not exist") ElseIf @error = 2 Then MsgBox(64, "Active Directory Message", "Computer '" & $sObject & "' does not exist") ElseIf @error = 3 Then MsgBox(64, "Active Directory Message", "Computer '" & $sObject & "' is already in the required OU. No change made.") ElseIf @error = "-2147352567" Then MsgBox(64, "Active Directory Message", "Could not move '" & $sObject) Else MsgBox(64, "Active Directory Message", "Return code '" & @error & "' from Active Directory") EndIf _AD_Close() I appreciate any thoughts anyone might have because I'm at a dead stop. Thanks in advance
- 15 replies
-
- AD
- ActiveDirectory
-
(and 1 more)
Tagged with:
-
Hi all. I was wondering whether anyone could kindly provide me with some examples of creating a group in AD as well as an OU please? Or is this not possible? Many thanks in advance!
- 6 replies
-
- active directory
- ad
-
(and 2 more)
Tagged with: