Some times the WSUS server on SCCM can stop. If the WSUSPool in IIS Application pools is stopped, WSUS will not function and SCCM will not update any clients. In anticipation of further troubleshooting, here is a workaround script to check the Application Pool and start it if it is not running. This script can…
Fun tip about powershell. You can pipe to the clipboard
1 2 3 4 5 6 7 8 9 10 11 |
<# Fun tip about powershell. You can pipe to the clipboard: #> Get-Help Get-Command | clip #or Get-Help about_Functions_Advanced_Parameters | clip # |
Get last logged on user with PowerShell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
# Get last logged on user on local computer $UserProperty = @{n="User";e={(New-Object System.Security.Principal.SecurityIdentifier $_.ReplacementStrings[1]).Translate([System.Security.Principal.NTAccount])}} $TypeProperty = @{n="Action";e={if($_.EventID -eq 7001) {"Logon"} else {"Logoff"}}} $TimeProperty = @{n="Time";e={$_.TimeGenerated}} Get-EventLog System -Source Microsoft-Windows-Winlogon | select $UserProperty,$TypeProperty,$TimeProperty | select -First 1 # Get last 100 logged on user entries on local computer $UserProperty = @{n="User";e={(New-Object System.Security.Principal.SecurityIdentifier $_.ReplacementStrings[1]).Translate([System.Security.Principal.NTAccount])}} $TypeProperty = @{n="Action";e={if($_.EventID -eq 7001) {"Logon"} else {"Logoff"}}} $TimeProperty = @{n="Time";e={$_.TimeGenerated}} Get-EventLog System -Source Microsoft-Windows-Winlogon | select $UserProperty,$TypeProperty,$TimeProperty | select -First 100 |
Find SMTP addresses using ActiveDirectory module in PowerShell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# On a DC, in Powershell: #See all smtp addresses for specific AD User Get-ADObject -Properties proxyAddresses -Filter {samaccountname -eq "ADUserSamAccountName"} | select -ExpandProperty proxyaddresses #See all smtp addresses by searching for parts of an smtp address Get-ADObject -Properties mail, proxyAddresses -Filter {mail -like "*portionOfMailAddress*"} | select -ExpandProperty proxyaddresses # If you have RSAT ( which you should ) on your own PC: #get the credetial of an administrative user $cred = Get-Credential DOMAIN\User # Import the Active Directory Module Import-Module ActiveDirectory #See all smtp addresses for specific AD User Get-ADObject -Credential $cred -Properties proxyAddresses -Filter {samaccountname -eq "ADUserSamAccountName"} | select -ExpandProperty proxyaddresses #See all smtp addresses by searching for parts of an smtp address Get-ADObject -Credential $cred -Properties mail, proxyAddresses -Filter {mail -like "*portionOfMailAddress*"} | select -ExpandProperty proxyaddresses |
How to get server core to always start with powershell on login
::server core always start with powershell ::in cmd type:
1 |
powershell |
#After entering powershell, type (or if lazy = ‘copy’ + ‘paste’)
1 |
Set-ItemProperty -Path ‘HKLM:SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon’ -Name Shell -Value PowerShell.exe |
Now you will automatically have powershell open as the shell at logon.
System Center Virtual Machine Manager build numbers
For those of you who are looking for System Center Virtual Machine Manager build numbers, there is a great wiki article on technet about this. https://social.technet.microsoft.com/wiki/contents/articles/15361.system-center-virtual-machine-manager-list-of-build-numbers.aspx