Skip to content

Instantly share code, notes, and snippets.

Kaido Järvemets Kaidja

Block or report user

Report or block Kaidja

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Disabled devices in Active Directory
#How many disabled devices in Active Directory
Get-ADComputer -Filter {(Enabled -eq $False)} | Measure-Object
View AD devices count
#How many devices in Active Directory
Get-ADComputer -Filter * | Measure-Object
View Invoke-WsusServerCleanup
Invoke-WsusServerCleanup `
-CleanupObsoleteComputers `
-CleanupObsoleteUpdates `
-CleanupUnneededContentFiles `
-CompressUpdates `
-DeclineExpiredUpdates `
View Get-ConfigMgrResourceFQDN
$CollectionMembers = Get-CMCollectionMember -CollectionId PS10008E
foreach($Member in $CollectionMembers){
$ResourceQuery = Get-CimInstance `
-Namespace 'Root\SMS\Site_PS1' `
-Query "Select * from SMS_R_System where ResourceID=$($Member.ResourceID)"
View Consolidate-ConfigMgrSWGroups.ps1
Import-Module $env:SMS_ADMIN_UI_PATH.Replace("\bin\i386","\bin\configurationmanager.psd1")
$CMSite = Get-PSProvider -PSProvider CMSITE
Set-Location -Path "$($CMSite.Drives.Name):\"
# 2017 Software Update Groups
#Create new Software Update Group for 2017 Updates
New-CMSoftwareUpdateGroup -Name 'SUM WRK 2017 Compliance'
#Get 2017 Software Updates Groups
$SWGroups = Get-CMSoftwareUpdateGroup -Name 'SUM WRK 2017*' -ForceWildcardHandling |
Kaidja / Clean-CMSoftwareUpdateGroup
Created Dec 6, 2017
Cleanup ConfigMgr Software Update Group
View Clean-CMSoftwareUpdateGroup
Set-CMSoftwareUpdateGroup -Name 'SUM WRK 2017 11 November' -ClearExpiredSoftwareUpdate -ClearSupersededSoftwareUpdate
You can’t perform that action at this time.