none
Windows 10 feature\AD modification RRS feed

  • Question

  • 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

    Wednesday, October 26, 2016 4:56 PM

Answers

  • PSCLientManager is not designed for Win 10.  Feature manage comes with Win 10;

    Get-WindowsOptionalFeature -Online

    help Get-WindowsOptionalFeature -full


    \_(ツ)_/

    • Marked as answer by Richardlaw Thursday, October 27, 2016 5:44 PM
    Wednesday, October 26, 2016 6:38 PM

All replies

  • RSAT tools always have been and still are free of charge. Download it and install it.

    Grüße - Best regards

    PS:> (79,108,97,102|%{[char]$_})-join''


    • Edited by BOfH-666 Wednesday, October 26, 2016 5:16 PM
    Wednesday, October 26, 2016 5:12 PM
  • The RSAT tools come on windows 10 image that I have. The issue is finding the right commands on Windows 10 to manage the programs and features to turn them on.
    • Edited by Richardlaw Wednesday, October 26, 2016 6:13 PM wording
    Wednesday, October 26, 2016 5:24 PM
  • If all else fails, you could finagle it by using a remote PSSession and invoke-command to run your portion of the script requiring the AD Module on a server with RSAT already installed.  If all you're doing is move the object in AD, this would be perfectly fine. 

    $ComputerDest = "ServerWithADModule"
    $Session = New-PSSession -ComputerName $ComputerDest 
    Invoke-Command -Session $Session -ScriptBlock {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-PSSession $Session



    Wednesday, October 26, 2016 6:18 PM
  • In windows 10 use to get list RSAT features. 

    Get-WindowsOptionalFeature -Online|?{$_.FeatureName -like "RSAT*"}

    To enable/install any of them you can use the example below. 

    Enable-WindowsOptionalFeature -Online -FeatureName RSATClient

    To disable

    Disable-WindowsOptionalFeature -Online -FeatureName RSATClient


    To enable all RSAT features at once
    $features = Get-WindowsOptionalFeature -Online|?{$_.FeatureName -like "RSAT*"}
    
    foreach($feature in $features)
        {
          $name = feature.FeatureName
          Enable-WindowsOptionalFeature -Online -FeatureName $name
        }
    
    To disable, change Enable to Disable.

    Wednesday, October 26, 2016 6:36 PM
  • PSCLientManager is not designed for Win 10.  Feature manage comes with Win 10;

    Get-WindowsOptionalFeature -Online

    help Get-WindowsOptionalFeature -full


    \_(ツ)_/

    • Marked as answer by Richardlaw Thursday, October 27, 2016 5:44 PM
    Wednesday, October 26, 2016 6:38 PM