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 the Windows Update service to "disabled" | |
| sc.exe config wuauserv start=disabled | |
| # display the status of the service | |
| sc.exe query wuauserv | |
| # stop the service, in case it is running | |
| sc.exe stop wuauserv | |
| # display the status again, because we're paranoid |
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
| Import-Module ActiveDirectory | |
| # Set the number of days since last logon | |
| $DaysInactive = 90 | |
| $InactiveDate = (Get-Date).Adddays(-($DaysInactive)) | |
| #------------------------------- | |
| # FIND INACTIVE COMPUTERS | |
| #------------------------------- | |
| # Below are three options to find inactive computers. Select the one that is most appropriate for your requirements: |