Home » Posts taggedremote file deletion

Get Duplicate users in a forest

(Get-aduser -filter * -server Domainname:3268 | Group-Object -Property UserprincipalName | ?{$PSItem.Count -gt 1 -and $PSItem.Name -ne “”}).group |export-csv c:\temp\duplic.csv -NoTypeInformation

Get active Computers in Forest

$ForestInfo=Get-ADForest $Domains =$forestInfo.domains $FileName =$ForestInfo.RootDomain+”-Windows_Servers_60-9_Days_Active-“+”$(get-date -Format MM-dd-yyyy)”+”.csv” $FilePath = “c:\temp” $Daysactive = 60 $lastactive=(get-date).AddDays(-($Daysactive)) foreach($domain in $domains){ Write-Output “Working on $domain” Get-ADComputer -Filter {OperatingSystem -like...

Testing open ports With PowerShell

We can use PowerShell to test remote port connectivity without installing telnet and with the use of the Test-NetConnection command. To check if the remote...

Get DC replication time response

foreach($d in (get-adforest).domains){$v = Measure-Command {get-addomaincontroller -Filter * -Server $d}Write-Output “Took $($v.TotalSeconds) to Enumerate DCS in $d “}

Created ISO image using PowerShell

Some Enterprise Organisations do not allow us to use any software on their networks a. Any software to be installed would need to be tested,...

Delete files based on the list of computers

Delete Files from Remote computers The following PowerShell script recipe will help you delete a remote file based on a list of computers stored in a text file. New PowerShell function...