Get Duplicate users in a forest

August 12, 2022 Jeevan Bobba 0

(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

June 17, 2022 Jeevan Bobba 2

$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 […]

Share folder permissions

April 15, 2022 Jeevan Bobba 1

#Share Folder Path $FolderPath = dir -Path “\\server1.vmwarenterprise.com\Reports\” -Recurse -Directory -Force$Report = @()Foreach ($Folder in $FolderPath) {$Acl = Get-Acl -Path $Folder.FullNameforeach ($Access in $acl.Access){$Properties = […]

Get DNS forwarder from forest

March 18, 2022 Jeevan Bobba 0

#Domain names in forest $ForestInfo = Get-ADForest$Domains =$forestInfo.domains$FileName = “DNSForwarder”+”$(get-date -Format MM-dd-yyyy)”+”.csv”$FilePath = “c:\temp”foreach($domain in $domains){Write-Output “Working on $domain”get-dnsserverforwarder -computer $domain| select IPAddress, @{l=”Domain”;e={$domain}}| Export-Csv […]

UPDATE DNS IP in List of computers

March 9, 2022 Jeevan Bobba 0

#Input file is CSV file with headers IPaddress $Computers = import-csv “c:\temp\servers.csv” ForEach ($Computer in $Computers) {Write-Host “$($Computer.IPAddress): ” -ForegroundColor YellowInvoke-Command -ComputerName $Computer.IPAddress -ScriptBlock { […]

Create Domain User and remove domain user

March 9, 2022 Jeevan Bobba 1

#Created domain user and add user account to domain group $domains = (get-adforest).domainsforeach($domain in $domains){$accountname = ‘s-user-‘+($domain -split “.”)[0]+’-DA’$accountpass = ‘P@ssword123456’ | ConvertTo-SecureString -Force -AsPlainTextWrite-Output […]

Get IP address and DNS of remote computers

March 9, 2022 Jeevan Bobba 0

$Computers = GC “c:\temp\servers.txt” foreach($computer in $computers){Get-WMIObject Win32_NetworkAdapterConfiguration -Computername $Computer | Where-Object {$_.IPEnabled -match “True”} |Select-Object -property DNSHostName,@{N=”DNSServerSearchOrder”;E={“$($_.DNSServerSearchOrder)”}},@{N=’IPAddress’;E={$_.IPAddress}}|export-csv c:\temp\DNSlist.csv -NoTypeInformation -append#@{N=’DefaultIPGateway’;E={$_.DefaultIPGateway}}}

No Image

Power Off listed VM’s

August 21, 2021 Jeevan Bobba 0

Connect to  Vcenter Connect-VIServer  vmwareenterprise.com -WarningAction 0 ####### Shutdown all VMs from the list “C:\temp\vm.txt“########### foreach($vmlist in (Get-Content -Path C:\TEMP\vm.txt)) { $vm = Get-VM -Name […]

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

Get users Group and members of the groups

June 17, 2022 Jeevan Bobba 0

$AllUSers = get-aduser -filter {SamAccountName -like “z*” -and Enabled -eq $true } -Properties Memberof,EmployeeNumber -Server <Domain name> | ?{$PSItem.DistinguishedName -notmatch “OU=Service Accounts”} $results = new-object […]

No Image

KMS activation

June 9, 2020 Jeevan Bobba 0

How do I manually connect my Windows or Windows Server device to the KMS activation server? Right Click on the Start menu and select Command Prompt (Admin) Run […]

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 […]

Moving Object from one OU to other OU

July 12, 2018 Jeevan Bobba 0

Get-Content C:\temp\Computers.txt| %{Move-ADObject -Identity “CN=$_,OU=WIN10,OU=ABC,OU=Computers,DC=CHILD,DC=Domain,DC=Vmwareenterprise,DC=com” -TargetPath “OU=Prod,OU=WIN10,OU=ABC,OU=Computers,DC=dev,DC=DIR,DC=vmwareenterprise,DC=com”} -Verbose

No Image

Username creation

May 7, 2018 Jeevan Bobba 0

Just give input as first name and last name in inputfile   Jeevan bobba Abcdef ghijklmnopqrst It will create username and by adding v- at […]

Citrix Ports

October 26, 2017 Jeevan Bobba 0

ICA#1494 RDP#3389 CGP#2598 IMA#2512 AMC#2513 XML#8080 License Manager Daemon#27000 Citrix Vendor Daemon#7279 License Management Console#8082 Citrix Receiver#80 Citrix Receiver#443 Offline Plug-in-SMB#445 Power & Capacity Management […]

Restart Multiple VM’s

October 12, 2017 Jeevan Bobba 0

 Connecting to individual host Open VMware vSphere PowerCLI console #Connect to the host Connect-VIServer -Server hostname.example.com #Get all VMs from the host, filter those powered […]

Free Vmware vsphere 6.5 training

September 20, 2017 Jeevan Bobba 0

Fell free to share with others… Features of vSphere 6 5 Lesson1.1 https://www.youtube.com/watch?v=XnvRAk7Fp6Y Introduction to the ESXi 6 Command Line Interface CLILesson1.1 https://www.youtube.com/watch?v=k0ikD9HXs-U The Course […]

New remote process

August 24, 2017 Jeevan Bobba 0

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, [String]$wait […]

No Image

How To Convert Text Into Audio

January 15, 2017 Jeevan Bobba 0

How To Convert Text Into Audio STEP 1: Open Notepad. Press Win+R and type Notepad and Press Enter. STEP 2: Now, Copy following program and paste it in Notepad Dim message, sapi message […]

No Image

Usefull Links

October 10, 2015 Jeevan Bobba 0

http://blog.feedspot.com/powershell_blogs/ Welcome to vmwareenterprise.com. Deploying vRealize Operations Manager http://bcove.me/j5ltvkxu Initial Setup of the Cluster http://bcove.me/zys7y3a5 Installation with High Availability http://bcove.me/n27a2ecz First Login for a New […]