This repository has been archived by the owner on Nov 13, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Home
andrebocchini edited this page Nov 23, 2012
·
8 revisions
Here are a few other examples of things you can do. Be sure to also take a look at the example script.
Get-SCCMComputer
Get-SCCMComputer "*SALES*"
New-SCCMComputer -computerName "NEW-COMPUTER" -macAddress "00:00:00:00:00:00"
Get-SCCMCollection
$collection = Get-SCCMCollection -collectionId "XXX000E9"
$collection.Name = "New Name"
Save-SCCMCollection $collection
$package = Get-SCCMPackage -packageId "XXX001D2"
$package.Name = "New Name"
Save-SCCMPackage $package
Get-SCCMAdvertisement
Get-SCCMFolder
$folder = GetSCCMFolder "Test Packages"
Move-SCCMPackageToFolder -packageId "XXX23034" -targetFolderNodeId $folder.ContainerNodeID
$variable = New-SCCMComputerVariable -variableName "Test Variable" -variableValue "Variable Value" -isMasked $false
Set-SCCMComputerVariables -resourceId 1234 -variableList $variable
Get-SCCMCollectionVariables -collectionId "XXX00032"
$computers = Get-SCCMCollectionMembers -collectionId "XXX000EA"
foreach($computer in $computers) {
Get-SCCMAdvertisementStatusForComputer -advertisementId "XXX20160" -resourceId $computer.ResourceID
}
You can then make a decision based on, for example, advertisement failures and send an alert email to the person responsible for fixing the issue.
Get-SCCMMaintenanceWindows -collectionId "XXX00012"
New-SCCMStaticCollection -collectionName "New Collection" -parentCollectionId "XXX12000"
Add-SCCMComputerToCollection -resourceId 3245 -collectionId "XXX12000"