Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #How old is your Windows install?
- gwmi Win32_OperatingSystem | select InstallDate
- #Spit out all the printers
- gwmi win32_printer | select Name, Portname, Default
- #Get Serial number/service tag
- gwmi win32_bios | select serialnumber
- #Shut down immediately, avoiding windows update:
- shutdown /s /t 0
- #Restart when you're logged in with RDP and the shutdown / restart commands are hidden:
- shutdown /r /t 0
- #Restart service
- restart-service servicename
- #List of all installed applications on a Windows device + all installed Windows Update files (KB)
- Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion, Publisher, InstallDate | Format-Table –AutoSize
- #This script will look for the host.bak file in C:\
- Get-Childitem -Path C:\ -Recurse -Filter hosts.bak -ErrorAction SilentlyContinue
- #Find Last Bootup Time
- Get-WmiObject win32_operatingsystem |select @{Name="Last Boot Time"; Expression={$_.ConvertToDateTime($_.LastBootUpTime)}}, PSComputerName
- #Find Your Public IP Address
- (Invoke-RestMethod ipinfo.io/json).ip
- #ipconfig /all equivalent gip is short for Get-NetIPConfiguration.
- gip
- #Show network adaptors
- get-netadapter
- #Restart remote computer
- restart-computer -computername [computer]
- #Sync Ad Changes without waiting for the next sync cycle before the minimum time between sync via Azure AD connect
- Start-ADSyncSyncCycle -PolicyType Delta
- #To display the detailed information about all available user attributes, run this command:
- Get-ADUser -identity tuser -properties *
- #Display all enabled AD users with First Name and Lastname
- Get-ADUser -Filter "(surname -like '*') -And (givenname -like '*') -and (enabled -eq '$true')" | ft Givenname,surname
- #Get AD groups a AD user is member of
- Get-ADPrincipalGroupMembership username | ft name
- #Export all AD Objects and all of their available attributes
- csvde -f output.csv
- #Check for accounts that don't have password expiry set
- Get-ADUser -Filter 'useraccountcontrol -band 65536' -Properties useraccountcontrol | export-csv C:\Windows\Temp\U-DONT_EXPIRE_PASSWORD.csv
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement