我正在读一份工作文件,里面有一堆职位头衔,但我不知道这些人到底是谁,我只知道他们的职位。
我知道全球通讯录中有这个信息,但我不知道如何输入一个职位(我猜位置),并得到一个实际的人的姓名和联系信息。
是否可以使用powershell“几乎”在GAL中查找联系人,使用职务名称作为输入,将联系人作为输出?
o365当然..。
发布于 2019-05-19 05:57:48
至于..。
是否可以使用powershell“几乎”在GAL中查找联系人,使用职务名称作为输入,将联系人作为输出?
..。简单的回答是的。您只需为它编写代码,就像如果这是就地交换一样,当然,通过PSRemote会话使用。
连接到EXO的日常用例,并详细记录了如何使用,来自Microsoft这里:连接到Exchange
$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session -DisableNameChecking或者直接使用MS PowerSHellGallery.com中的脚本
https://www.powershellgallery.com/packages/Connect-O365/1.5.4/Content/Connect-O365.ps1
或者这个
然而,请记住,女孩是从AD来的。所以,如果你是在一个混合环境中,你可以点击你的现场广告来获得这个。
您有一个内置的cmdlet,用于用户搜索AD和EXP/EXO:
Get-Command -Name '*adaccount*' | Format-Table -AutoSize
CommandType Name Version Source
----------- ---- ------- ------
Alias Set-ADAccountPasswordHash 3.4 DSInternals
Cmdlet Clear-ADAccountExpiration 1.0.1.0 ActiveDirectory
Cmdlet Disable-ADAccount 1.0.1.0 ActiveDirectory
Cmdlet Enable-ADAccount 1.0.1.0 ActiveDirectory
Cmdlet Get-ADAccountAuthorizationGroup 1.0.1.0 ActiveDirectory
Cmdlet Get-ADAccountResultantPasswordReplicationPolicy 1.0.1.0 ActiveDirectory
Cmdlet Search-ADAccount 1.0.1.0 ActiveDirectory
Cmdlet Set-ADAccountAuthenticationPolicySilo 1.0.1.0 ActiveDirectory
Cmdlet Set-ADAccountControl 1.0.1.0 ActiveDirectory
Cmdlet Set-ADAccountExpiration 1.0.1.0 ActiveDirectory
Cmdlet Set-ADAccountPassword 1.0.1.0 ActiveDirectory
Cmdlet Unlock-ADAccount 1.0.1.0 ActiveDirectory
# get function / cmdlet details
(Get-Command -Name Search-ADAccount).Parameters.Keys
Get-help -Name Search-ADAccount -Full
Get-help -Name Search-ADAccount -Online
Get-help -Name Search-ADAccount -Examples
Search-ADAccount -AccountDisabled | FT Name,ObjectClass -A
Search-ADAccount -AccountDisabled -UsersOnly | FT Name,ObjectClass -A
Search-ADAccount -AccountExpired | FT Name,ObjectClass -A
Search-ADAccount -AccountExpiring -TimeSpan 6.00:00:00 | FT Name,ObjectClass -A
Search-ADAccount -AccountInactive -TimeSpan 90.00:00:00 | FT Name,ObjectClass -A
Search-ADAccount -PasswordExpired | FT Name,ObjectClass -A
Search-ADAccount -PasswordNeverExpires | FT Name,ObjectClass -A
Search-ADAccount -LockedOut | FT Name,ObjectClass -A
Search-ADAccount -AccountDisabled -ComputersOnly | FT Name,ObjectClass -A
Search-ADAccount -AccountExpiring -DateTime "3/18/2009" | FT Name,ObjectClass -A
Search-AdAccount -AccountDisabled -SearchBase "DC=AppNC" -Server "FABRIKAM-SRV1:60000"
# Or just use
(Get-Command -Name Get-ADUser).Parameters.Keys
Get-help -Name Get-ADUser -Full
Get-help -Name Get-ADUser -Online
Get-help -Name Get-ADUser -Examples
# If you are really wanting to do this using EXP/EXO, then it provide a cmdlet to help
Get-ADObject -ldapfilter "(&(objectClass=contact)(objectCategory=person)(!showinAddressBook=*))" -properties *您也可以使用ADAC为您编写这段代码,只需单击这些步骤并根据需要保存要修改的代码。按照下面的指示。
使用Active管理中心学习PowerShell (PowerShell历史查看器)
https://stackoverflow.com/questions/56202417
复制相似问题