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
$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
$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
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
# Specify vCenter Server, vCenter Server username and vCenter Server user password | |
$vCenter="lab.asvignesh.in" | |
$vCenterUser="[email protected]" | |
$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
$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
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
package viewmodel; | |
import play.mvc.QueryStringBindable; | |
import java.util.Map; | |
import java.util.Optional; | |
public class PaginationParams implements QueryStringBindable<PaginationParams> { | |
private int page; | |
private int offset; |
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
from datetime import datetime, timedelta, timezone | |
import boto3 | |
class Ec2Instances(object): | |
def __init__(self, region): | |
print("region "+ region) | |
self.ec2 = boto3.client('ec2', region_name=region) | |
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
Options: | |
--all Show all metadata information for this host (also default). | |
-a/--ami-id The AMI ID used to launch this instance | |
-l/--ami-launch-index The index of this instance in the reservation (per AMI). | |
-m/--ami-manifest-path The manifest path of the AMI with which the instance was launched. | |
-n/--ancestor-ami-ids The AMI IDs of any instances that were rebundled to create this AMI. | |
-b/--block-device-mapping Defines native device names to use when exposing virtual devices. | |
-i/--instance-id The ID of this instance | |
-t/--instance-type The type of instance to launch. For more information, see Instance Types. | |
-h/--local-hostname The local hostname of the instance. |