dear all,
I have a problem with adding a client during osd to a device collection.
After install of the os en sccm client we want to add it automatically to a device collection where windows updates are linked to.
I ve found a script on the web which we adapted to our needs
_____________________________________
$computer = hostname $remotesession = New-PSSession -ComputerName YourSiteServer -ConfigurationName Microsoft.PowerShell32
Invoke-Command -Session $remotesession -ScriptBlock {
param($computer)
Import-module 'D:\Program Files\Microsoft Configuration Manager\AdminConsole\bin\ConfigurationManager.psd1'
Set-Location YourSiteCode:
Add-CMDeviceCollectionDirectMembershipRule -CollectionName "YourCollectionName" -ResourceID (Get-CMDevice -Name $computer).ResourceID
} -Args $computer
Remove-PSSession $remotesession
__________________________________
powershell remote connection is enabled on our sccm server, but the execution is blocked by our server.
I think we have to set the executionpolicy on our server but which one and which value do we have to set?
thank you al