首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何通过职称从powershell查询GAL?

如何通过职称从powershell查询GAL?
EN

Stack Overflow用户
提问于 2019-05-18 20:00:27
回答 1查看 1.1K关注 0票数 0

我正在读一份工作文件,里面有一堆职位头衔,但我不知道这些人到底是谁,我只知道他们的职位。

我知道全球通讯录中有这个信息,但我不知道如何输入一个职位(我猜位置),并得到一个实际的人的姓名和联系信息。

是否可以使用powershell“几乎”在GAL中查找联系人,使用职务名称作为输入,将联系人作为输出?

o365当然..。

EN

回答 1

Stack Overflow用户

发布于 2019-05-19 05:57:48

至于..。

是否可以使用powershell“几乎”在GAL中查找联系人,使用职务名称作为输入,将联系人作为输出?

..。简单的回答是的。您只需为它编写代码,就像如果这是就地交换一样,当然,通过PSRemote会话使用。

连接到EXO的日常用例,并详细记录了如何使用,来自Microsoft这里:连接到Exchange

代码语言:javascript
复制
$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

或者这个

https://gallery.technet.microsoft.com/office/Connect-to-Office-53f6eb07/file/221497/1/Connect-Office365Services.ps1

然而,请记住,女孩是从AD来的。所以,如果你是在一个混合环境中,你可以点击你的现场广告来获得这个。

您有一个内置的cmdlet,用于用户搜索AD和EXP/EXO:

代码语言:javascript
复制
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管理中心增强功能简介(100级)

使用Active管理中心学习PowerShell (PowerShell历史查看器)

逐步:在Windows 2012 R2中使用R2历史记录查看器

使用Active管理中心在Windows 2012中创建PowerShell命令

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56202417

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档