
Mastering Credential Management in PowerShell: A Comprehensive Guide
Introduction As a PowerShell administrator, securely handling credentials is one of the most critical aspects of scripting and automation. In this post, we’ll explore various […]
Introduction As a PowerShell administrator, securely handling credentials is one of the most critical aspects of scripting and automation. In this post, we’ll explore various […]
Introduction: Managing permissions on shared folders is a crucial aspect of maintaining data security and accessibility within an organization’s network infrastructure. Windows servers offer various […]
(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
$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 […]
$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 […]
There is no excerpt because this is a protected post.
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 […]
#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 = […]
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 domain account in each domain add it to domain admin group $domains = (get-adforest).domainsforeach($domain in $domains){$accountname = ‘s-coe-‘+($domain -split “.”)[0]+’-DA’$accountpass = ‘P@ssword123456’ | ConvertTo-SecureString […]
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, […]
#get all AD users in forest with name like v- and status is enable $allusers = (get-adforest).domains| %{get-aduser -filter {SamAccountName -like “v-*” -and Enabled -eq […]
#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 […]
#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 { […]
#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 […]
$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}}}
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 […]
dsquery user -startnode forestroot -samid <username> | dsmod user -pwd <new_password> DsQuery | HomeWorks’s Blog (wordpress.com)
Add multiple DNS servers as name servers to multiple DNS zones all in once. So this is essentially adding NS resource records to a zone, […]
Get Password Policy for all domains in a forest.. (Get-ADForest).domains | %{Get-ADDefaultDomainPasswordPolicy -Identity $_ } | Select-Object * | Export-Csv -Path C:\Reports\DefaultPasswordPolicy-All.csv -NoTypeInformation Having […]
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 […]
$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 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 # Return the current logged-in user of a remote machine. # ——————————————- function Get-LoggedIn { […]
Function Name: Get-Uptime # ——————————————- # Function Name: Get-Uptime # Calculate and display system uptime on a local machine or remote machine. # ——————————————- function […]
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 […]
Activate a Windows Operating System (All Supported Versions) Open an Elevated Command Prompt window. In the elevated Command Prompt window, verify that the current […]
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 […]
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, […]
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 […]
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 […]
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
Description The Get-ADOrganizationalUnit cmdlet gets an organizational unit (OU) object or performs a search to get multiple OUs. This cmdlet gets a default set of OU object […]
Just give input as first name and last name in inputfile Jeevan bobba Abcdef ghijklmnopqrst It will create username and by adding v- at […]
Computer uptime is an important statistic in systems management. Here are several of the ways we can determine system uptime for a computer (note that […]
If you want to turn off the Windows Firewall, there are three methods. One is using the GUI which is the method that takes the most […]
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 […]
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 […]
Communication flow during the different stages of the Citrix XenApp/XenDesktop logon process 1. The user device submits credentials to the Web Interface (WI) or StoreFront (SF) […]
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 […]
Towards a better console – PSReadLine for PowerShell command line editing Sometimes text mode is where it’s at. I’ve long blogged about tools and […]
Powershell script to email ###########Define Variables######## $date = “get-date” $fromaddress = “[email protected]” $toaddress = “[email protected]” $Subject = “Test $(get-date)” $body = Get-Content C:\temp\Test.htm #$attachment = […]
when I updated to 7.14 I had the issue, because my license server and my delivery controller cannot communicate outside there is also a ugly […]
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 […]
I often have to copy files and folders from one server to another for various reasons. Copying stuff manually is a bore but if you […]
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 […]
If you’ve deleted these machines from AD and DDC (I assume by using Desktop Studio to delete the machines) then you can get back to […]
Error after an update of the Machine Catalog Solution: Open Powershell as administrator and find out the running Task ID on the Machine Catalog. Add-PSSnapin […]
You can find this through the following command: echo %LOGONSERVER% And you don't have to be admin or poweruser to use it. Have a […]
ESXi/ESX version Hardware version Compatible with vCenter Server version Version 11 Version 10 Version 9 Version 8 Version 7 Version 4 ESXi 6.0 Create, […]
Windows Operating System 6.5 6.0 U2 6.0 U1 6.0 5.5 U3 5.5 U2 5.5 U1 5.5 5.1 U3 5.1 U2 5.1 U1 5.1 5.0 U3 […]
Useful Windows Command Prompt Tricks 1. Command History Using this command, you can track down your command history. This will turn out to be useful when […]
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 […]
Overview Everything in Linux can be reduced to a file. Partitions are associated with files such as /dev/hda1. Hardware components are associated with files […]
Connect to Vcenter Connect-viserver vc.abc.com Stop-VM -VM (gc C:\Temp\serverlist.txt) -Confirm:$false
I tried to make this script as simple as possible for day-to-day use. This script takes three parameters: ObjectType: Type of object that you want […]
PowerCLI 6.5.1 has been released and in this release VMware have made some big changes to the way you install and keep up to date […]
Use a manual method to reset TCP/IP Note This section is intended for advanced computer users. If you are not comfortable with advanced troubleshooting, ask […]
If the function name contains a hyphen (eg. test-computername): ${function:test-Computername} Alternatively: (Get-Command test-Computername).Definition Or cat function:show-list To export function to text file cat function:test-computername >c:\temp\function
There is no excerpt because this is a protected post.
This example helps identify the mail server for a given email address. This is useful for Identify your own SMTP mail server to use with […]
Side bar(Tool bar) that appears with Adobe Acrobat Reader with options like Export PDF, Create PDF, Edit PDF, etc, is frustrating sometimes as you […]
POWERSHELL SCRIPT COPY fILES USING ROBOCOPYPOWERSHELL SCRIPT COPY fILES USING ROBOCOPY Please find powershell code which will assist you in copying data from source location to destination […]
Instead of modifying termsrv.dll file you can use RDP Wrapper which acts as a middleman between Terminal Services and Service Control Manager. This way you don't need to touch termsrv.dll file. Actually, […]
Hello guys in this post i will tell you how you can easily setup your own hands-on lab at your home in your pc but […]
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 […]
Copyright © 2025 | WordPress Theme by MH Themes