# Grant a service logon rights
Get-UserRightsGrantedToAccount -Account IC\Z-SRV-CWT-DATASYNC
Grant-UserRight -Account IC\Z-SRV-CWT-DATASYNC -Right SeServiceLogonRight
# Get an AD controller
$adcontroller = get-addomaincontroller -DomainName nww.external -Discover
# Get memory use of processes grouped by process name
get-process -computername . | Group-Object -Property ProcessName | Format-Table Name, @{n='Mem (KB)';e={'{0:N0}' -f (($_.Group|Measure-Object WorkingSet -Sum).Sum / 1KB)};a='right'} -AutoSize
# Get process id of a running service
Get-WmiObject -Class Win32_Service -Filter "Name LIKE 'Nhs.Digital.Cwt.Compliance.Service'" | Select-Object -ExpandProperty ProcessId