This file contains hidden or 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 DENYSYSTEMACCOUNTPERMISSIONS | |
| { | |
| Import-DscResource –ModuleName 'AccessControlDSC' -ModuleVersion 1.4.1 | |
| Node ConfigurePrintSpoolerFolderPermissions { | |
| NTFSAccessEntry SpoolDriversFolder | |
| { | |
| AccessControlList = @( |
This file contains hidden or 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 ENABLEDSCPRINTSPOOLERLOGCONFIG { | |
| Import-DscResource –ModuleName 'ComputerManagementDsc' | |
| Node StandardConfiguration { | |
| WindowsEventLog EnablePrintServiceOperationalLogs | |
| { | |
| LogName = "Microsoft-Windows-PrintService/Operational" | |
| IsEnabled = $True |
This file contains hidden or 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() |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |