Home » Articles posted by Jeevan Bobba (Page 3)

Backup GPOs basing on GPO DisplayName

$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...

Activate Windows with KMS server

Activate Windows with KMS Server Step 1: KMS Client Setup Key Before activating your Microsoft product (Windows or Office) on the KMS server, you must change...

Function Name: Get-LoggedIn

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

Function Name: Get-Uptime

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

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...

Add Notes To Multiple VM’s

Note: This script will overwrite the existing Notes, so use it at your own risk! My colleague asked me to add some notes to the...

NewRemote-Process

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

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...

Get DHCP Scopes using PowerShell

We need DHCP PowerShell cmdlet to be available in order to manage DHCP. By default, the DHCP module is not loaded in PowerShell. We need...