在 Windows 下讓 del 指令有個 alias name: rm
方法:
- 建立 C:\Windows\System32\rm.cmd
- 內容:
@echo off
del %*
技術記事與生活
在 Windows 下讓 del 指令有個 alias name: rm
方法:
# AutoOpenFileTypes: qdsGPO: Computer Configuration → Administrative Templates → Microsoft Edge → List of file types that should be automatically opened on downloadNew-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Edge\AutoOpenFileTypes" -Force | Out-NullNew-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Edge\AutoOpenFileTypes" -Name "1" -Value "qds" -PropertyType String -Force | Out-Null# AutoOpenAllowedForURLs: 只允許 intranet.contoso.comGPO: Computer Configuration → Administrative Templates → Microsoft Edge → URLs where AutoOpenFileTypes can applyNew-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Edge\AutoOpenAllowedForURLs" -Force | Out-NullNew-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Edge\AutoOpenAllowedForURLs" -Name "1" -Value "intranet.contoso.com" -PropertyType String -Force | Out-Null
Change this from 2 to 0
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PasswordLess\Device]
"DevicePasswordLessBuildVersion"=dword:00000000
Create a .reg file with the following:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PasswordLess\Device]
"DevicePasswordLessBuildVersion"=dword:00000000
Next:
Command: netplwiz
➨ Check: Users must enter a user name and password to use this computer
<?xml version="1.0" encoding="UTF-8"?><ruleset version="1.0+"><rule><id location="https://plmap.contoso.com.tw/"/><action permission="run"/></rule><rule><id location="https://plmifs.contoso.com.tw:8080/"/><action permission="run"/></rule><rule><id/><action permission="default"/></rule></ruleset>
Install two network interfaces on a single Windows Server with the following IP addresses:
10.11.11.11 (physical NIC)10.22.22.22 (Description: Microsoft KM-TEST Loopback Adapter)批次建立 win-acme 用 DNS Record 取得憑證的任務
$RecordNames = @();
$RecordNames += "www";
$Domain = "contoso.com";
foreach ($RecordName in $RecordNames) {
$FQDN = ($RecordName + '.' + $Domain);
write-host ('Request Certificate for ' + $FQDN);
前情提要: 在 Microsoft DNS Server 上用 DNS Record 來驗證 Let's Encrypt 的 PowerShell Script
$PublishedURL = "www.contoso.com"
$IISSiteName = "www.contoso.com"
$PFXPath = "C:\Cert\Cert\"
$Password = "password"
$PFXFullPath = "$PFXPath$PublishedURL.pfx"
$pfx = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2
$pfx.Import($PFXFullPath, $Password, [System.Security.Cryptography.X509Certificates.X509KeyStorageFlags]::EphemeralKeySet)
Import-Module IISAdministration
在 Exchange Online 如果寄給某個外部網域的信件無法送達,不要退信給原寄件者
方法是透過 Remote Domain 設定停用 NDR(Non-Delivery Report)
首先要建立 Remote Domain (在 EAC Mail flow -> Accepted domains)
New-RemoteDomain -Name "DomainNameOne" -DomainName "Domain.Name.One"
New-RemoteDomain -Name "DomainNameTwo" -DomainName "Domain.Name.Two"
停用 NDR必須用 PowerShell 指令,EAC 不支援 (這裡的 -Identity 是上面的 -Name)
Set-RemoteDomain -Identity "DomainNameOne" -NDREnabled $false
Set-RemoteDomain -Identity "DomainNameTwo" -NDREnabled $false