Cant Move Computer into an OU via Powershell
greetings,
below script im trying run in adps. im trying move pc 1 ou , put username in description field. able "set-adcomputer $computer -description $userid" working "move-adobject $computer -targetpath 'ou=laptops,ou=pc-computers,dc=pc,dc=com'" i'm having trouble with.
i'm thinking its syntax issue wrong. assistance great.
thanks all.
##laptop name username ou name## $computer= read-host "what name of laptop move laptop ou?" $userid= read-host "what name of user computer?" ##move laptop ou## move-adobject $computer -targetpath 'ou=laptops,ou=pc-computers,dc=pc,dc=com' ##add name description in computer object## set-adcomputer $computer -description $useridhere error throws.
move—adobject : cannot find object identity: ‘2ua2061fnh’ under: ‘dc=pc
, dc=com’ .
at c:\powershell\movelaptop4.ps1:6 char:14
+ move—adobject « $computer -targetpath ‘ou=laptops,ou=pc-computers,dc=pc, dc=com’
+ categorylnfo : objectnotfound: <2ua2061fnh:adobject) [move—adob
ject]. adldentitynotfoundexception
+ fullyqualifiederrorld : cannot find object identity: ‘2ua2061fnh'
‘ under: ‘dc=pc,dc=com’ .,microsoft.activedirectory.managenent.commands.
move adobject
richard mueller - mvp directory services
Windows Server > Windows PowerShell
Comments
Post a Comment