This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public Timestamp getCreatedDate() throws RemoteException { | |
| final EventFilterSpec eventFilterSpec = new EventFilterSpec(); | |
| eventFilterSpec.setEventTypeId(new String[]{"VmCreatedEvent", "VmBeingDeployedEvent", "VmRegisteredEvent", "VmClonedEvent"}); | |
| EventFilterSpecByEntity entity = new EventFilterSpecByEntity(); | |
| entity.setEntity(virtualMachine.getMOR()); | |
| EventFilterSpecRecursionOption recOption = EventFilterSpecRecursionOption.self; | |
| entity.setRecursion(recOption); | |
| eventFilterSpec.setEntity(entity); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $vmProp = ""|Select VMname,CreatedTime | |
| if ($CollectedEvent=$vm|Get-VMEvents -types 'VmBeingDeployedEvent','VmRegisteredEvent','VmClonedEvent','VmBeingCreatedEvent' -ErrorAction SilentlyContinue) | |
| { | |
| if($CollectedEvent.gettype().isArray){$CollectedEvent=$CollectedEvent|?{$_ -is [vmware.vim.VmRegisteredEvent]}} | |
| $CollectedEventType=$CollectedEvent.gettype().name | |
| $CollectedEventCreationDate=$CollectedEvent.CreatedTime | |
| $vmProp.VMname=$CollectedEvent.vm.Name | |
| $vmProp.CreatedTime=$CollectedEventCreationDate | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Specify vCenter Server, vCenter Server username and vCenter Server user password | |
| $vCenter="lab.asvignesh.in" | |
| $vCenterUser="administrator@vsphere.local" | |
| $vCenterPassword="secretPassword" | |
| # | |
| # Specify number of VMs | |
| $vm_count = "100" | |
| # | |
| # Specify the template | |
| $tempate = "W2k12" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import-module sqlps | |
| $total =2 | |
| $volume1 = "E:" | |
| $volume2 = "F:" | |
| $backupLocation = "C:\Users\asvignesh\Downloads\AdventureWorks2016.bak" | |
| $database_prefix = "vignesh-testing" | |
| foreach($count in 1..$total) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $nodes = @("nim-win1-4.asvigneshad.local","nim-win2-5.asvigneshad.local","nim-win3-3.asvigneshad.local","nim-win4-1.asvigneshad.local","nim-win5-5.asvigneshad.local") | |
| $username = "asvigneshad\administrator" | |
| $password = "Password" | |
| $secstr = New-Object -TypeName System.Security.SecureString | |
| $password.ToCharArray() | ForEach-Object {$secstr.AppendChar($_)} | |
| $cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $username, $secstr | |
| For ($i=0; $i -lt $nodes.Length; $i++) { | |
| $sess = New-PSSession -Credential $cred -ComputerName $nodes[$i] | |
| Enter-PSSession $sess | |
| $script = "./tmp.dsh" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $nodes = @("nim-win1-4.asvigneshad.local","nim-win2-5.asvigneshad.local","nim-win3-3.asvigneshad.local","nim-win4-1.asvigneshad.local","nim-win5-5.asvigneshad.local") | |
| $username = "asvigneshad\administrator" | |
| $password = "Password" | |
| $secstr = New-Object -TypeName System.Security.SecureString | |
| $password.ToCharArray() | ForEach-Object {$secstr.AppendChar($_)} | |
| $cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $username, $secstr | |
| For ($i=0; $i -lt $nodes.Length; $i++) { | |
| $sess = New-PSSession -Credential $cred -ComputerName $nodes[$i] | |
| Enter-PSSession $sess | |
| Set-Itemproperty -path 'HKLM:\Software\Microsoft\Windows\CurrentVersion\policies\system' -Name 'EnableLUA' -value 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| param( | |
| $serverName, | |
| $backupDirectory | |
| ) | |
| [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SMO") | Out-Null | |
| [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SmoExtended") | Out-Null | |
| [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.ConnectionInfo") | Out-Null | |
| [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SmoEnum") | Out-Null |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| param( | |
| $serverName, | |
| $backupDirectory | |
| ) | |
| [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SMO") | Out-Null | |
| [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SmoExtended") | Out-Null | |
| [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.ConnectionInfo") | Out-Null | |
| [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SmoEnum") | Out-Null |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| param( | |
| $serverName, | |
| $backupDirectory | |
| ) | |
| [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SMO") | Out-Null | |
| [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SmoExtended") | Out-Null | |
| [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.ConnectionInfo") | Out-Null | |
| [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SmoEnum") | Out-Null |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| param( | |
| $serverName, | |
| $backupDirectory | |
| ) | |
| [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SMO") | Out-Null | |
| [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SmoExtended") | Out-Null | |
| [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.ConnectionInfo") | Out-Null | |
| [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SmoEnum") | Out-Null |