各ユーザーのログオン数をカウントし、ログオン全体を表示したいと考えています。私はそのPowershellでDirectoryServices.ResultPropertyValueCollecitonをIntに変換する
$search = new-object DirectoryServices.DirectorySearcher([ADSI]"")
$search.filter = "(objectClass=user)"
$result = $search.FindAll()
#amount of User in AD
Write-Host Amount of user: $result.Count
#CountLogon
$logonCounter = 0
foreach($person in $result){
$logonCounter += $person.properties.logoncount
}
Write-host Number of Logons: $logonCounter
のように私はこのスクリプトを実行するとことをやった私が手
入力するタイプ 「System.DirectoryServices.ResultPropertyValueCollection」の 「System.CirectoryServices.ResultPropertyValueCollection」の値を変換できません 可能System.Int32"
ありがとう – andreaspfr