Backup GPOs basing on GPO DisplayName

May 21, 2020 Jeevan Bobba 0

$invalidChars = ‘:\\/’ + [RegEx]::Escape(-join [IO.Path]::InvalidPathChars) $backupDir = ‘C:\temp\backup’ Get-GPO -All -Domain <DOmain Name>| ForEach-Object { $name = $_.DisplayName -replace “[$invalidChars]”, ‘_’ $gpoDir = Join-Path […]

No Image

Function Name: Get-LoggedIn

April 21, 2019 Jeevan Bobba 0

Function Name: Get-LoggedIn   # ——————————————- # Function Name: Get-LoggedIn # Return the current logged-in user of a remote machine. # ——————————————- function Get-LoggedIn { […]

No Image

Function Name: Get-Uptime

April 21, 2019 Jeevan Bobba 0

Function Name: Get-Uptime # ——————————————- # Function Name: Get-Uptime # Calculate and display system uptime on a local machine or remote machine. # ——————————————- function […]

VM inventory using Powershell

January 24, 2019 Jeevan Bobba 0

Set-PowerCLIConfiguration -DefaultVIServerMode Multiple -Scope User -Confirm:$false Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Scope User -Confirm:$false #$cred = Get-Credential Domain\username Connect-VIServer VCenter-Name -Credential $cred -force & { foreach ($vCenterServer […]

NewRemote-Process

January 5, 2019 Jeevan Bobba 0

cls Function New-RemoteProcess { #[CmdletBinding()] Param( [String]$ComputerName = $env.computername, [String]$Cmd = $(Throw “You must enter path to the command which will create the process”), [String]$ac, […]

Delete User profiles using DELPROF2

August 23, 2018 Jeevan Bobba 0

Create .csv file with  column name “Computername” $servers = import-csv C:\Temp\servers.csv $comps = ($servers).ComputerName $comps | %{ New-Item -ItemType Directory -Force \\$PSItem\c$\Temp; Copy-Item C:\Temp\Delprof \\$PSItem\c$\Temp\Delprof […]