PowerShell:: PowerCLI:: Provision multiple VMs from a Template on Vmware

Below script create multiple VMs from the same template on same cluster and datastore $noVms = Read-host "Enter number of VMs to be created" $cluster = Read-host "Enter Name of the cluster" $dsCluster = Read-host "Enter Name of the Datastore cluster" $template = Read-host "Enter template name" Connect-VIServer <vcenter server name> -Credential (Get-Credential -Message "Credential … Continue reading PowerShell:: PowerCLI:: Provision multiple VMs from a Template on Vmware

Advertisements

Powershell:: Uninstall the application remotely (Get the servers/computer from AD )

Below script to uninstall an application from remote servers (or a number of the remote servers). You can also import the list of computers from a txt file using ($computers = get-content .\computer.txt) $computers = get-adcomputer -filter 'OperatingSystem -like "*Windows Server*"' -SearchBase "<Server name FQDN" foreach($comp in $computers){ $computer = $comp.name $error.clear() $log = Invoke-Command … Continue reading Powershell:: Uninstall the application remotely (Get the servers/computer from AD )

Powershell Script:: Check Possible Security update or Server reboot Failure:: SCCM

Powershell script to check last reboot status, Remote desktop connection and/or ping response status The script will retrieve the list of servers that not rebooted in last 15 days (assuming the last windows update happened a month or 2 back), check the ping status, to verify the server still online, and check RDP connection (to … Continue reading Powershell Script:: Check Possible Security update or Server reboot Failure:: SCCM

POWERSHELL SCRIPT:: DHCP BACKUP SCRIPT WITH NOTIFICATION

This script can be scheduled from a remote machine to execute across DHCP servers Below command to find list of Authorized DHCP servers, (Get-ADObject -SearchBase "cn=configuration,dc=domain,dc=net" -Filter "objectclass -eq 'dhcpclass' -AND Name -ne 'dhcproot'").name, this can be incorported instead of  [array]$lists = @(“DHCP01″,”DHCP02″,”DHCP03”). Like [array]$lists = (Get-ADObject -SearchBase "cn=configuration,dc=domain,dc=net" -Filter "objectclass -eq 'dhcpclass' -AND Name -ne 'dhcproot'").name Below … Continue reading POWERSHELL SCRIPT:: DHCP BACKUP SCRIPT WITH NOTIFICATION

POWERSHELL SCRIPT :: Request for Certifcate and Import in to Remote Machine

Below script created to achieve certain requirement of include non-production domains servers in to SCOM monitoring, where gateway servers are not available and no PKI environment to issue certificate. First part generate, import, and Export certificate (pfx) with private key and Second part import pfx certificate in to local machine. Need to create Computers.csv with … Continue reading POWERSHELL SCRIPT :: Request for Certifcate and Import in to Remote Machine

PowerCLI to Migrate VMs across vCenter servers

Below script which was created for a unique requirement with us for migrating our 6.0 vcenter to 6.5 appliance. Since we have planned for complete refresh of the hardware along with vCenter server. we have not used vCenter migration assistance https://blogs.vmware.com/vsphere/2017/01/vcenter-server-appliance-6-5-migration-walkthrough.html We have two vCenter environment with different set of hardware, we had around 25 … Continue reading PowerCLI to Migrate VMs across vCenter servers

PowerCLI :: Update VM IP Addresses without runas administrator

Hello Friends, Yet another issue I have faced recently on updating the server VM IP address through powerCLI without running console or remote in to server. Situation was we were moving our existing production VMware environment from  one hardware solution another, vmotion of the VM from one vCenter to another failed for few servers due … Continue reading PowerCLI :: Update VM IP Addresses without runas administrator

Introduction to Powershell Desired state Configuration (PowershellDSC)

What is Powershell Desired state configuration? Powershell DSC is a declarative model of system configuration management Microsoft released along with Windows 2012, but enhanced and matured on Windows 2016. In other word, you will be able to specify how you want a computer or servers to be configured and leave it to Powershell and the … Continue reading Introduction to Powershell Desired state Configuration (PowershellDSC)