This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Import-CMMaintenanceWindows.ps1 -MWsInputFile E:\Scripts\MW\Maintenance_Solution.csv -Delimiter ',' -Production |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-ChildItem PS1:\Application | Select-Object -Property Name,ContainerNodeID,ObjectType |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$FolderID = 16777224 # ContainerNodeID property value | |
$SiteCode = "PS1" | |
$Query = "select * from SMS_ApplicationLatest where ModelName is | |
in(select InstanceKey from SMS_ObjectContainerItem where ObjectType='6000' and ContainerNodeID='$FolderID')" | |
$ApplicationsInFolder = Get-WmiObject -Namespace "ROOT\SMS\Site_$SiteCode" -Query $Query | |
$ApplicationsInFolder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Set-CMApplication -InputObject $ApplicationsInFolder -NewName "IT - Dell Command Monitor 2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$SCCMCMPSHObject = ConvertTo-CMIResultObject -InputObject $ApplicationsInFolder | |
Set-CMApplication -InputObject $SCCMCMPSHObject -NewName "IT - Dell Command Monitor 2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ObjectPath = "/Dell/Sub1" | |
$ApplicationsInFolder = Get-WmiObject -Namespace "ROOT\SMS\Site_PS1" ` | |
-Query "select * from SMS_ApplicationLatest where ObjectPath = '$ObjectPath'" | |
$ApplicationsInFolder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Invoke-Command -ScriptBlock { | |
Stop-Service -Name Spooler -Force | |
Set-Service -Name Spooler -StartupType Disabled | |
} -ComputerName SERVER1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Stop-Service -Name Spooler -Force | |
Set-Service -Name Spooler -StartupType Disabled |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Configuration DSCDISABLEPRINTSPOOLER { | |
Import-DscResource –ModuleName 'PSDesiredStateConfiguration' | |
Node StandardConfiguration { | |
Service PrintSpooler { | |
Name = "Spooler" | |
DisplayName = "Print Spooler" | |
Ensure = "Present" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$AllLogs = Get-WinEvent -ListLog * | |
$PrinterLogs = $AllLogs | where LogName -eq "Microsoft-Windows-PrintService/Operational" | |
$PrinterLogs.IsEnabled = $True | |
$PrinterLogs.SaveChanges() |