ADDS integrated Azure File Share
1. Azure vNet DNS set to ADDS DNS
2. Add Private DNS zone (Or Auto Create in Step 3.2.3)
2.1 Named: privatelink.file.core.windows.net
2.2 Add Virtual Network Link
ADDS integrated Azure File Share
1. Azure vNet DNS set to ADDS DNS
2. Add Private DNS zone (Or Auto Create in Step 3.2.3)
2.1 Named: privatelink.file.core.windows.net
2.2 Add Virtual Network Link
PowerPoint 很小氣,預設輸出圖片只有 1280x720
如果需要輸出高解析度的話必須要修改註冊機碼
微軟說明在此:
https://docs.microsoft.com/en-us/office/troubleshoot/powerpoint/change-export-slide-resolution
HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\PowerPoint\Options
$Password = ("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".tochararray() | sort {Get-Random})[0..15] -join ''
$Password
$Password = ("!@#$%^&0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".tochararray() | sort {Get-Random})[0..15] -join ''
$Password
for ($i=0;$i -lt 20;$i++) {
("!@#$%^&0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".tochararray() | sort {Get-Random})[0..15] -join ''
};
$ResourceGroup = "ResourceGroupName"
$SourceDiskName = "SourceDiskName"
$TargetDiskName = "TargetDiskName"
$SourceDisk = Get-AzDisk -ResourceGroupName $ResourceGroup -DiskName $SourceDiskName
$DiskConfig = New-AzDiskConfig -SourceResourceId $SourceDisk.Id -Location $SourceDisk.Location -CreateOption Copy -DiskSizeGB $SourceDisk.DiskSizeGB -SkuName "Premium_LRS"
New-AzDisk -Disk $DiskConfig -DiskName $TargetDiskName -ResourceGroupName $ResourceGroup
傳 imagemap Message Type 的圖片 URL 給 Line 的時候
Line 會用 https://xxx/Path/To/image.png/1040 取代 https://xxx/Path/To/image.png
由於我只要提供一張圖片而已不區分解析度,所以想用 mod_rewrite 的方式處理
因為不熟悉正規表達式,網路搜尋老半天後暫時只能用以下方式處理
不知道那個 /Path/To/ 要怎麼用變數取代,否則就只能寫 .htaccess 在該路徑
並把 Path/To 寫 Hard Code 進去 Orz
RewriteEngine On
RewriteRule ^(.*)/1040 /Path/To/$1 [L]
如果有人會的話竟請不吝提供 m(_ _)m
Section 1: Create Password File
# Get PasswordSection 2: Read Password File
$PassWord = Read-Host -Prompt 'Please Enter Password';
# Convert to System.Security.SecureString
$PassWord = ConvertTo-SecureString -String $PassWord -AsPlainText -Force
# Encrypt it
$Encrypted = ConvertFrom-SecureString -SecureString $Password
# Save to File
$Encrypted | Set-Content Encrypted.txt
# Read From File and Convert to System.Security.SecureString
$Password = Get-Content Encrypted.txt | ConvertTo-SecureString
先參考這篇 取得 AD 群組成員的指令 Group Members List
本篇為進階用,產生報表用
#-------------------------------------------------------
$OUFileter = 0
$UserOU = "OU=Users,DC=Contoso,DC=com"
Download mod_authnz_sspi from Here (The ApacheHaus US)
Uncompress it and copy mod_authnz_sspi.so to Apache\modules
Add Configuration in http.conf
LoadModule authnz_sspi_module modules/mod_authnz_sspi.so
快速調整 User Profile Disk 磁碟與分割區大小
紅色部份為應調整參數
$ExtendDiskSize = 16; #in GB
$DiskPartCommandFileName = ((Get-Location).Path + '\DiskPartCommand.txt');
$ExtendDiskSize = ($ExtendDiskSize*1024*1024*1024);
$VHDxs = Get-ChildItem -path 'C:\VirtualDisks\Pool' -Recurse -Filter "*.vhdx" | select FullName;
只不過想用個 Resize-VHD 指令
被罵說沒有 Hyper-V Role,但這台機器 (Azure VM) 又不支援巢狀虛擬化 (懶得去設定)
只好用指令裝起來,但要記得裝好重開機之前用第二行指令設定開機時不要跑 Hypervisor
不然應該會壞掉
dism /online /enable-feature /featurename:Microsoft-Hyper-V
bcdedit /set hypervisorlaunchtype off
$ResourceGroup = "ResourceGroupName"
$SourceDiskName = "OsDisk_12345678"
$TargetDiskName = "NewDiskName"
$VMName = "VMName"
$SourceDisk = Get-AzDisk -ResourceGroupName $ResourceGroup -DiskName $SourceDiskName
$DiskConfig = New-AzDiskConfig -SourceResourceId $SourceDisk.Id -Location $SourceDisk.Location -CreateOption Copy -DiskSizeGB $SourceDisk.DiskSizeGB -SkuName "Premium_LRS"
New-AzDisk -Disk $DiskConfig -DiskName $TargetDiskName -ResourceGroupName $ResourceGroup
$VM = Get-AzVm -ResourceGroupName $ResourceGroup -Name $VMName
$TargetDisk = Get-AzDisk -ResourceGroupName $ResourceGroup -Name $TargetDiskName
Set-AzVMOSDisk -VM $VM -ManagedDiskId $TargetDisk.Id -Name $TargetDisk.Name
Update-AzVM -ResourceGroupName $ResourceGroup -VM $VM
Remove-AzDisk -ResourceGroupName $ResourceGroup -DiskName $SourceDiskName -Force
There is a lot of stuff to study to use Azure Automation.
Therefor I Write a simple PowerShell Script to manage the Scaling of WVD Pool.
You have to use the script with saved credential. (Reference)
######## Script Start ########
$ResourceGroupName = 'WVD_Infrastructure'; # ResourceGroup that contains HostPool
$WorkDayTimeStart = '08:30';
$WorkDayTimeEnd = '18:30';
$WorkTimeAvailableSessionThreshold = 2; #New VM will Start if remain this session only
$RestTimeAvailableSessionThreshold = 0; #New VM will Start if remain this session only
$CredentailFileName = "AzCredential.txt";
$TimePeriod = 30;
$ResourceGroupName = 'ResourceGroupName';
$HostPoolName = 'HostPoolName';
#-------------------------------
$EndTime = Get-Date;
$StartTime = $EndTime.addminutes(-$TimePeriod)
Get-AzWvdUserSession -ResourceGroupName $ResourceGroupName -HostPoolName $HostPoolName | select UserPrincipalName,ActiveDirectoryUserName,ApplicationType,Name,SessionState
$HostPool = $(Get-AzWvdSessionHost -ResourceGroupName $ResourceGroupName -HostPoolName $HostPoolName);
ForEach ($HostName in $HostPool) {
$CPUUtilizationSum = 0;
$HostCPUUtilization = Get-AzMetric -ResourceId $HostName.ResourceId -MetricNames "Percentage CPU" -TimeGrain 00:01:00 -DetailedOutput -StartTime $StartTime -EndTime $EndTime; $HostCPUUtilization.Data.Average.ForEach({$CPUUtilizationSum += [int]$_;}); $CPUUtilizationAverage = ($CPUUtilizationSum / $HostCPUUtilization.Data.Average.Length) write-host ('' + $HostName.Name + "`t" + $CPUUtilizationAverage);
};
web_browser_homepage about:blank
enable_3dmodelspace_browser_tab no
enable_partcommunity_tab no
enable_resource_browser_tab no
...\bin\proe.exe -g:win32_gdi
graphics win32_gdi
How to make scroll wheel zoom work in Windows 10
HKEY_LOCAL_MACHINE\SOFTWARE\FSLogix\Profiles
Convert-CertificateBinaryToBase64 -Sourcefile 'C:\Cert\Certification.cer' -DestinationFile 'C:\Cert\CertificationCER.txt'
Convert-CertificateBinaryToBase64 -Sourcefile 'C:\Cert\Certification.crt' -DestinationFile 'C:\Cert\CertificationCRT.txt'
function Convert-CertificateBinaryToBase64 {
Param( [String]$SourceFile, [String]$DestinationFile )
$Cert = Get-Content "$SourceFile" -Encoding Byte
$Content = @(
'-----BEGIN CERTIFICATE-----'
[System.Convert]::ToBase64String($Cert, 'InsertLineBreaks')
'-----END CERTIFICATE-----'
);
$Content | Out-File -FilePath "$DestinationFile" -Encoding ASCII
};
Prerequest:
Behavior:
# First Create Credential File
$CredentailFileName = "AzCredential.txt";
$Credential = Get-Credential
$UserName =[Convert]::ToBase64String([System.Text.Encoding]::Unicode.GetBytes($Credential.UserName))
$Password = ConvertFrom-SecureString -SecureString $Credential.Password -Key (1..16)
($UserName,$Password) | Set-Content -Path $CredentailFileName
遇到了莫名其妙的問題來記錄一下
因為 VM 效能突然變得超差,幾乎無反應無法運作
檢查發現 Hyper-V Host 出現 CPU Loading 0% 的情況
這台是 HP Server 運作 Windows Server
certutil.exe –generateSSTFromWU "C:\Cert\TrustedRootCA\roots.sst"
(Get-ChildItem -Path C:\Cert\TrustedRootCA\roots.sst) | Import-Certificate -CertStoreLocation Cert:\LocalMachine\Root
FORFILES /P %WINDIR%\servicing\Packages /M Microsoft-Windows-InternetExplorer-*11.*.mum /c "cmd /c echo Uninstalling package @fname && start /w pkgmgr /up:@fname /norestart"新版 IE 在此下載