Microsoft
Software
Hardware
Network
Question : PowerShell in Windows 7 - HowTo Add-Computer to specific OU?
In Windows 7, we need to use the PowerShell command to add a computer to a domain specific OU.
We used to use a netdom join command for Windows Vista and Server 2008. NetDom is not included with Win7 or Win2K8 R2 from what I can see.
So, we need to use PowerShell. The Add-Computer command should accomplish what we need, but I sure cannot get to the proper syntax using the Help or online.
The targeted OU: OU=Win7OU,OU=MyBusiness,OU
=Computers
,DC=MySBSD
omain,DC=L
ocal
Domain: MySBSDomain.local
Win7 non-domain joined name: MY-Win7Beta
I have tried many different iterations of the command with no success.
Here is one (with and without the "" on the OU fails):
PS C:\Users\Information Services> Add-Computer -Credential MySBSDomain\Administrator -OUPath "OU=Win7OU,OU=Computers,OU
=MyBusines
s,DC=MySBS
Domain,DC=
Local" -Passthru -Server MySBSDomain\MySBSServer -ComputerName MY-Win7Beta -DomainName MySBSDomain.local
Add-Computer : This command cannot be executed on target computer('MY-Win7Beta') due to following error: Access is denied.
At line:1 char:13
+ Add-Computer <<<< -Credential MySBSDomain\administrator -OUPath "OU=Win7OU,OU=Computers,OU
=MyBusines
s,DC=MySBS
Domain,DC=
Local" -passthru -Server MySBSDomain\MySBSServer -ComputerName MY-Win7Beta -DomainName MySBSDomain.local
+ CategoryInfo : InvalidOperation: (My-Win7Beta:String) [Add-Computer], InvalidOperationException
+ FullyQualifiedErrorId : InvalidOperationException,
Microsoft.
PowerShell
.Commands.
AddCompute
rCommand
I am looking for the properly formatted syntax to run in PowerShell itself. This is priority number 1.
From there, a script would be good to go too.
Thanks.
Philip
Answer : PowerShell in Windows 7 - HowTo Add-Computer to specific OU?
I just got word... this already fixed and should be in the next release
Random Solutions
Supressing controls with Null values in Access Report
Reports hang during printing
How to Reset Page Number in SQL Reporting Services for new grouping..
Setting up External Access to Sharepoint
Cannot Reply using Outlook Web Access (OWA) , Windows XP and IE7
Internal IP not updating
Missing Outlook 2003 Message-ID header
Need to Emerge a masked MySQL 4.1.7 on Gentoo Linux System...
Install libtool and grep on AIX 5.3
Windows 2003 expanding drive C