默认分类 清理Windows 登录认证的缓存(Token) 1. Run PowerShell as admin: Set-Service TokenBroker -StartupType Disabled Stop-Service TokenBroker -Force -PassThru 2. Delete the folder: %localappdata%\Packages\Microsoft.AAD.BrokerPlugin_cw5n1h2txyewy\AC\TokenBroker\Accounts %localappdata%\Packages\Microsoft.AAD.BrokerPlugin_cw5n1h2txyewy\Settings\settings.dat 3. Rename registry key: Computer\HKEY_CURRENT_USER\Software\Microsoft\IdentityCRL\TokenBroker\DefaultAccount ---> Computer\HKEY_CURRENT_USER\Software\Microsoft\IdentityCRL\TokenBroker\DefaultAccount_backup 4. Run PowerShell as admin: Set-Service TokenBroker -StartupType Manual Start-Service TokenBroker -PassThru 阅读全文 2025-08-22 丿记性不太好丶 0 条评论 321 次浏览
默认分类 自定义UPN自动生成 New-EmailAddressPolicy -Name "Test-UPN策略" ` -RecipientFilter { (RecipientType -eq 'UserMailbox') -and (UserPrincipalName -like '*@test.com') } ` -EnabledEmailAddressTemplates "SMTP:%u@test.com" ` -Priority 2 2. 立即应用策略(确保现有用户同步更新) Update-EmailAddressPolicy -Identity "Test-UPN策略" 3. 验证策略是否生效(替换"用户名"为实际用户) Get-Mailbox -Identity "用户名" | Select-Object UserPrincipalName, EmailAddresses 阅读全文 2025-08-22 丿记性不太好丶 0 条评论 298 次浏览
默认分类office365 关闭Microsoft目录同步 定义参数哈希表 $updateParams = @{ OrganizationId = $org.Id # 组织ID OnPremisesSyncEnabled = $false # 禁用目录同步 } 通过哈希表传递参数(@ 符号展开) Update-MgOrganization @updateParams 阅读全文 2025-08-19 丿记性不太好丶 0 条评论 299 次浏览
默认分类 通过AAD删除用户 Get-AzureADUser -All $true | Where-Object {$_.userprincipalname -notlike "admin@xxxxx.com"} | Remove-AzureADUser 阅读全文 2025-08-17 丿记性不太好丶 0 条评论 302 次浏览
默认分类 使用powershell连接Exchange Online 命令行 对于中国或德国的租户,需要使用 -ExchangeEnvironmentName 参数并分别指定 O365China 或 O365Germany。 对于安全的美国政府租户,需要指定 O365USGovGCCHigh 或 O365USGovDOD。 ``` Set-ExecutionPolicy RemoteSigned Install-Module -Name ExchangeOnlineManagement #连接 Exchange Online PowerShell 国际版 Connect-ExchangeOnline #连接 Exchange Online PowerShell 国内版 Connect-ExchangeOnline -ExchangeEnvironmentName O365China #断开连接 Disconnect-ExchangeOnline ``` 阅读全文 2025-08-12 丿记性不太好丶 0 条评论 315 次浏览