Quantcast
Channel: Configuration Manager 2012 - Operating System Deployment forum
Viewing all articles
Browse latest Browse all 9126

Task Sequence - Moving computer to new OU

$
0
0

I have a SCCM 2012 SP1 Cumulative Update 3 environment and I am trying to build a step into my Win7 x64 task sequence that will query registry keys to get username and workstation type (laptop vs. desktop).

The user information is obtained at the beginning of the process, put into n TS variable, and written to the registry. After the OS, drivers, and basic software is installed, I would restart into OS and would like to query the registry, move the computer OU based off user's domain id location, and rename computer via a powershell script.

I have the following steps built into the task sequence.

1. Install .Net Framework 4.5

2. Install WMF 4.0

3. Enable RSAT and Import AD Module

4. Move and Rename Computer

I am running into issues with the powershell script that runs on step 4. The script is running with an ID account that has privileges to query AD and move computers. All steps (1-4) run without any issues if I target the computer that already has an OS installed.

Here is the command that I am running in the step 4: 

powershell.exe -ExecutionPolicy Bypass -File SHI_Computer-New.ps1

It fails on the first line that queries the registry with an error that states “Get-ITemProperty is not recognized as a cmdlet, function, operable program, or script file.

$Name = (Get-ItemProperty -Path HKLM:\SYSTEM\Setup\SCCMOSD -Name User).User

Has anyone seen this type of issue?

If I hit F8 and run the script as local system from the Packages folder that contains the script I can run the script without any issues.

Any feedback is greatly appreciated!

 


Viewing all articles
Browse latest Browse all 9126

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>