我查询 Office365 以获取与Chris的 displayName 匹配的所有用户的列表。
我想提示用户他们想要选择哪个克里斯。这样做时,我有以下 for..each 代码
$tmpUserOffice = Get-MsolUser -SearchString "*Chris*"
if ($tmpUserOffice -is [array])
{
if ($tmpUserOffice.Count -lt 50) {
Write-Host "Many matching users in MSOL. Choose which one you want to save"
for ($i = 0; $i -lt $tmpUserOffice.Count; $i++) {
Write-Host $i " " $($tmpUserOffice[$i].DisplayName)
}
Write-Host $tmpUserOffice.Count " None of the above"
$chosen = Read-Host
if ($chosen -eq $tmpUserOffice.Count) {
Write-Warning "Nothing found. Try searching with different criteria or use wildcards"
Write-Output $null …
Run Code Online (Sandbox Code Playgroud) 我能够在 MacOSX 上安装 Powershell Core,现在我正在尝试从它管理 Azure AD 实例。
当我安装 AzureAD 模块时,出现以下错误
PS /Users/c> Install-Module -name AzureAD
Untrusted repository
You are installing the modules from an untrusted repository. If you trust this
repository, change its InstallationPolicy value by running the Set-PSRepository
cmdlet. Are you sure you want to install the modules from 'PSGallery'?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help
(default is "N"):y
PackageManagement\Install-Package : Unable to load DLL 'api-ms-win-core-sysinfo-l1-1-0.dll': The specified …
Run Code Online (Sandbox Code Playgroud) macos azure azure-powershell azure-active-directory powershell-core
我正在尝试更新本文的代码,以允许我创建(和使用)基于 ECC 的自签名证书,并使用它进行基本的签名和验证( ECDSA)。
根据这篇文章,我需要使用the more standard id-ecc
类型
cryptography public-key .net-core .net-4.6 self-signed-certificate
以下存储在powershell中
#Maintainer Note: The leftmost parameter must match the registry key name exactly e.g. 'DES 56'
#For more information please check https://support.microsoft.com/en-us/kb/245030
$bannedCiphersJSON = @"
{
"RC4 128/128":{
"IsPermitted":false,
"AffectedCiphers":[
"SSL_RSA_WITH_RC4_128_MD5",
"SSL_RSA_WITH_RC4_128_SHA",
"TLS_RSA_WITH_RC4_128_MD5",
"TLS_RSA_WITH_RC4_128_SHA"
]
},
"Triple DES 168":{
"IsPermitted":false,
"AffectedCiphers":[
"SSL_RSA_WITH_3DES_EDE_CBC_SHA",
"SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA" ,
"TLS_RSA_WITH_3DES_EDE_CBC_SHA" ,
"TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA"
]
},
"RC4 56/128":{
"IsPermitted":false,
"AffectedCiphers":[
"TLS_RSA_EXPORT1024_WITH_RC4_56_SHA"
]
},
"DES 56":{
"IsPermitted":false,
"AffectedCiphers":[
"SSL_RSA_WITH_DES_CBC_SHA"
]
},
"RC4 40/128":{
"IsPermitted":false,
"AffectedCiphers":[
"SSL_RSA_EXPORT_WITH_RC4_40_MD5",
"TLS_RSA_EXPORT_WITH_RC4_40_MD5"
]
},
"RC2 40/128":{
"IsPermitted":false,
"AffectedCiphers":[
"SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5",
"TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5"
]
},
"MD5":{ …
Run Code Online (Sandbox Code Playgroud) powershell ×2
.net-4.6 ×1
.net-core ×1
azure ×1
cryptography ×1
json ×1
macos ×1
public-key ×1
write-host ×1