|
|
|||||||
Hoping someone can answer this for me. I am trying to add a compter object to a group object in AD. I've got it working for users, but it's computers I really need it to work for. I have a script to determine if a computer is a laptop or desktop. I then need these computers adding to an appropriate group so GPOs can be filtered against them. Here is the code I got working for adding a user (pretty simple) Code: $Group=GetObject("WinNT://DomainName/TESTGROUP,group") However, when I try to use the following instead it doesn't work and I get the error "COM exception error "Add" ((null) - (null)) [-2147352567/80020009]" Code: $Group=GetObject("WinNT://DomainName/TESTGROUP,group") Is it not possible to add a computer to a group using this method? All I could find in searching was to add a user to a group. Wanting to get it working while logged in as Domain Admin, then I'll try to set the security on a group to allow computers to add themselves. Any help would be great, it's bugging the hell out of me |
||||||||
|
|
|||||||
Try treating the computer as the user account it truly is. The computer's account ends in a "$" sign. |
||||||||
|
|
|||||||
Tried appending $ and $$, but no joy. I get this error instead for both: COM exception error "Add" (Active Directory - An invalid directory pathname was passed) [-2147352567/80020009] |
||||||||
|
|
|||||||
Comp=GetObject("WinNT://DomainName/TestCompName,computer") did you treat it as a user? Comp=GetObject("WinNT://DomainName/TestCompName$$,user") |
||||||||
|
|
|||||||
Your a damn genius, that's what you are!!! |
||||||||
|
|
|||||||
Just an OLD Codger Howard's a great guy, just spends too much time on Disney Blast! site |
||||||||
|
|
|||||||
I gave up on the Disney site. I am now a Xbox Halo2 junky... |