Hello Scripting Guys.
Last week you all helped me with modifying features on Windows 7 and it was a great help, this week I need your help modifying features on a Windows 10 Client Workstation. The overall goal is to run a script during a task sequence Via SCCM 2012 that will look at the computer name and determine what OU in active directory it should go, then move it. The issue I am having is that unless you install the RSAT tools (programs and features) you don't have access to the AD module in PowerShell without buying it and my company is cheep.
I have considered installing the PSClientmanager on to the system to modify the features but it is not loading the commands. I have researched what commands to use and I can only find server based commands. I could really use some help. I know I might be taking the long way around here but I am at my wits ends.
Here is my script.
start-process -file "\\path\PSClientManager.msi" /qn -Wait Import-Module PSClientManager ADD-ClientFeature –Name RSATClient -NoRestart -Force | Out-Null Import-Module ActiveDirectory $OS = get-adcomputer -Identity $env:COMPUTERNAME -Properties OperatingSystem | Select -ExpandProperty OperatingSystem If($OS -eq "Windows 10 Enterprise"){ if ($env:COMPUTERNAME -Match "HQUW") {get-ADComputer $env:COMPUTERNAME | Move-ADObject -TargetPath "OU=Workstations..."} if ($env:COMPUTERNAME -Match "HQUL") {get-ADComputer $env:COMPUTERNAME | Move-ADObject -TargetPath "OU=Laptops..."} if ($env:COMPUTERNAME -Match "HQUT") {get-ADComputer $env:COMPUTERNAME | Move-ADObject -TargetPath "OU=Mobile..."} } Remove-ClientFeature –Name RSATClient -NoRestart -Force | Out-Null