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

Updates not uninstalling :: An error has occurred. Not all the updates successfully uninstalled :: 0x80073712

Issue: Unable install or uninstall Windows updates on Windows 2016 (Windows 8/10/2012 operating system) It failed with "An error has occurred. Not all the updates successfully uninstalled" Event log says "Package KB4056890 failed to be changed to the Absent state. Status: 0x80073712." DISM.log has logged with below error lines 2018-02-09 09:53:45, Info                  DISM   DISM Package … Continue reading Updates not uninstalling :: An error has occurred. Not all the updates successfully uninstalled :: 0x80073712

Access Denied When Editing MSMQ Messsage Queuing Properties

Issue:  We were trying to adjust Private Message Queuing properties (specifically, message storage limits, Access Permission) via Computer Management on my machine. It fails with the following message: The properties of cannot be set. Error: Access is denied. Reason: MSMQ created private Queue by application, application was using system account to create the queue. Unable … Continue reading Access Denied When Editing MSMQ Messsage Queuing Properties

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

KNOWN ISSUE :: POWERPATH INSTALLATION ISSUE (WINDOWS 2016)

Issue: Powerpath Installation failing on Windows 2016 server Operating system. Installation abruptly ended with error “Powerpath detected a problem with MPIO feature” Casuse : MPIO missing Fix: MPIO feature must be enabled before proceeding with installation of powepath on servers. Install MPIO feature from Server manager, restart the server and proceed with Powerpath installation. NB: Always install … Continue reading KNOWN ISSUE :: POWERPATH INSTALLATION ISSUE (WINDOWS 2016)

Ansible playbook for change the root user password

Techworld

Ansible playbook for change the root user password

Requirements:

  • Need to create inventory files with list of hostnames
  • Need to copy encrypted password from /etc/shadow or you can use perl script to generate. Then paste the password to YAML file below.

Syntax:-

$  ansible-playbook -i <inventory_file> <filename.yml>

Filename.yml  contents


– hosts: all
become: yes
vars:
password: Copy the encrypted password values here

tasks:
– name: Change root password
user: name=root update_password=always password={{password}}

View original post