I quiet often receive the question how to enable Remote Desktop (RDP) access on a server during a task sequence in SCCM 2012 or 2012 R2. Because by default RDP is not enabled, it could be realy handy to enable RDP access to control your server remotely. There’re a whole bunch of tools to manage your server(s) remotely, but still RDP could be ncessary.
1.) Create a new package with the source location to your script directory.
2.) Create a new package with a program and use the following command:
Powershell.exe -ExecutionPolicy Unrestricted -NoProfile -File Enable-RDP.ps1
3.) The PowerShell script ‘Enable-RDP.ps1’ contains the following code. See in this post below.
4.) Insert the script in your task sequence
## Enable RDP
Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server' -name "fDenyTSConnections" -Value 0
## Enable Firewall Rule
Enable-NetFirewallRule -DisplayGroup "Remote Desktop"
## Enable RDP Authentication
Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -name "UserAuthentication" -Value 0
Today I want to edit an task sequence within SCCM 2012 and I received the following error message: “Cannot edit the object, which is in use by site P01”. Mmmm….that’s strange!! I’m the only Sysadmin with an ConfigMgr 2012 Management Console. To unlock this object, I’ve used an query within SQL.
1.) Open the SQL Management Console and navigate to the ConfigMgr database
2.) Open a new query
3.) To view all the locked objects, type the following query:
select * from SEDO_LockState
Execute the query and watch te results
4.) We see one object that is locked
5.) Note the ID of this specific object
6.) To unlock this object, type the following query:
delete from SEDO_LockState where ID=’ID of the object’
Execute the query and watch the results
7.) Now the object is succesfully unlocked and you’re able to edit the task sequence
When you have multiple computer models in your organization, you have different driver packages available. Each model has his own driver package. You don’t want to use a task sequence per model, but only one task sequence with multiple models in it with different driver packages. This can be accomplished by using a WMI query within your task sequence.
One mayor thing you have to know are the exact computer models in your organization
1.) Create a new task sequence. (in my example Windows 7)
2.) Add a task Apply Driver Package
3.) Select the right Driver Package
4.) Navigate to the Options tab
5.) On the target PC open the command prompt
6.) The next thing you want to know is the hardware model of the target PC.
WMIC ComputerSystem GET model
In my example it is an Dell OptiPlex 9010 as you can see
7.) Navigate back to your task sequence in the Options tab
8.) The WMI namespace will be root\cimv2
9.) The WQL Query will be SELECT * FROM Win32_ComputerSystem WHERE Model LIKE “%OptiPlex 9010”
10.) Now the right driver package will be installed during your task sequence.