This file contains 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
$LicenseOption = New-MsolLicenseOptions -AccountSkuId $DisablePlanSKUID -DisabledPlans $PlanName | |
Set-MsolUserLicense -UserPrincipalName $UPN -AddLicenses $AssignLicenseSKU -LicenseOptions $LicenseOption |
This file contains 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
## 接続情報 | |
$user = "hogehoge@hoge.onmicrosoft.com" | |
$pass = "pasuwa-do" | |
## Credential 生成 | |
$str = ConvertTo-SecureString $pass -AsPlainText -Force | |
$psc = New-Object System.Management.Automation.PsCredential($user, $str) | |
$O365Cred = Get-Credential -Credential $psc | |
## 接続 |
This file contains 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
$user = “hogehoge@hoge.onmicrosoft.com” | |
$pass = “pass” | |
$CTSS = ConvertTo-SecureString $pass -AsPlainText -Force | |
$PSC = New-Object System.Management.Automation.PsCredential($user, $CTSS) | |
$O365LyncCred = Get-Credential -Credential $PSC | |
Import-Module LyncOnlineConnector | |
$LyncSession = New-CsOnlineSession -Credential $O365LyncCred | |
Import-PSSession $LyncSession |
This file contains 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 -Name virtualmachinemanager | |
$Hostname = "<<HostName>>" | |
Get-SCVMHost -VMMServer $Hostname |ForEach-Object {$_.VMs }|Select-Object Name,VMHost,Cloud,VMAddition | |
Get-SCVMHost -VMMServer $Hostname |ForEach-Object {$_.VMs }|Select-Object Name,VMHost,Cloud,VMAddition|OGV | |
Get-SCVMHost -VMMServer $Hostname |ForEach-Object {$_.VMs }|Select-Object Name,VMHost,Cloud,VMAddition,VMCPath|FT | |
Get-SCVMHost -VMMServer $Hostname |ForEach-Object {$_.VMs }|Select-Object Name,VMHost,Cloud,VMAddition,VMCPath|OGV |
This file contains 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
# initialize | |
[string]$GuestVMName = 'WSTP2_02' | |
[int]$cnt = 1 | |
$PSList = $null | |
# Create login credential | |
$Sstr = ConvertTo-SecureString "password1!" -AsPlainText -Force | |
$psc = New-Object System.Management.Automation.PsCredential("Administrator", $Sstr) | |
$Cred = Get-Credential -Credential $psc | |
This file contains 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
# SCVMM LibraryのISOを FileShareでmountしていると ライブラリ更新時に「iso を更新できません。ファイルは別のプロセスによって使用されています。」 | |
# と表示されるが、実際どのVMがmountしているかわからないので、ISOをmountしているVMの一覧を抽出する | |
Get-SCVirtualMachine | ? {$_.VirtualDVDDrives.ISOId -ne $null} | SELECT NAME |
This file contains 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
# get wmi object | |
$obj=get-wmiobject -Namespace root -Class __ProviderHostQuotaConfiguration | |
# current settings | |
Write-Host -Object ("HandlesPerHost:{0}" -f $obj.HandlesPerHost) | |
# update object | |
$obj.HandlesPerHost = 8192 | |
$obj.Put() | |
# get wmi object |
This file contains 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
<# | |
.DESCRIPTION | |
Nested Azure Stack Deployment Script | |
.EXAMPLE | |
.\Deploy-NestedAzureStack.ps1 -Verbose | |
.EXAMPLE | |
.\Deploy-NestedAzureStack.ps1 -Verbose -VMName "HostName" -Remove | |
.EXAMPLE | |
.\Deploy-NestedAzureStack.ps1 -VMName "MAS" -CPUCore 32 -RAMSize 184 -DiskSize 200 -Verbose | |
.INPUTS |
This file contains 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
# NATVM Credential | |
$LoginUser = "Administrator" | |
$LoginPass = "NATVMPassword" | |
$Sstr = ConvertTo-SecureString $LoginPass -AsPlainText -Force | |
$psc = New-Object System.Management.Automation.PsCredential($LoginUser, $Sstr) | |
$Cred = Get-Credential -Credential $psc | |
#create nat vSwitch | |
$SubnetPrefix = "192.168.255.0/24" |
This file contains 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
$DriveLetter = "Z" | |
$USBDeviceFriendlyName = "Generic USB Flash Disk" | |
$ISOPath = "D:\ISOs\ja_windows_10_multiple_editions_xxx.iso" | |
Get-Disk | where FriendlyName -EQ $USBDeviceFriendlyName | Clear-Disk -RemoveData -PassThru | New-Partition -UseMaximumSize -IsActive -DriveLetter $DriveLetter | Format-Volume -FileSystem FAT32 -NewFileSystemLabel USB -Force; | |
Mount-DiskImage $ISOPath; | |
$DVDDriveLetter = (Get-DiskImage $ISOPath | Get-Volume).DriveLetter; | |
Copy-Item "$($DVDDriveLetter):\*" "$($DriveLetter):\" -Recurse -Force -Verbose; |
OlderNewer