Get-Help显示不同系统上的不同输出

时间:2018-06-14 11:48:58

标签: powershell

当我使用以下cmdlet时:

Get-Help Get-ADUser -Parameter identity

在安装了RSAT并连接到Windows Server 2012 R2的Windows 7上,我得到以下输出:

-Identity <ADUser>
Specifies an Active Directory user object by providing one of the following property values. The identifier in
parentheses is the LDAP display name for the attribute.

  Distinguished Name
    Example:  CN=SaraDavis,CN=Europe,CN=Users,DC=corp,DC=contoso,DC=com
  GUID (objectGUID)
    Example: 599c3d2e-f72d-4d20-8a88-030d99495f20
  Security Identifier (objectSid)
    Example: S-1-5-21-3165297888-301567370-576410423-1103
  SAM account name  (sAMAccountName)
    Example: saradavis

The cmdlet searches the default naming context or partition to find the object. If two or more objects are found
the cmdlet returns a non-terminating error.

This parameter can also get this object through the pipeline or you can set this parameter to an object instance

This example shows how to set the parameter to a distinguished name.
  -Identity  "CN=SaraDavis,CN=Europe,CN=Users,DC=corp,DC=contoso,DC=com"

This example shows how to set this parameter to a user object instance named "userInstance".
  -Identity   $userInstance

Required?                    true
Position?                    1
Default value
Accept pipeline input?       true (ByValue)
Accept wildcard characters?  false

但是,当我在安装了WMF 5.1的Windows Server 2012 R2或2016上使用它时,我只能得到以下内容:

-Identity <ADUser>
Required?                    true
Position?                    1
Default value
Accept pipeline input?       true (ByValue)
Accept wildcard characters?  false

知道我做错了吗?

1 个答案:

答案 0 :(得分:2)

Get-ADUser命令来自系统模块&#39;即使使用相同版本的WMF,即使版本号由&#39; Get-Command Get-ADUser&#39;显示,也可能与操作系统不同。是相同的(1.0.0.0)...所以帮助内容也可能不同。

顺便说一下,我在带有WMF 5.1的Windows 2012 R2上得到了这个结果

-Identity <ADUser>
    Specifies an Active Directory user object by providing one of the following property values. The identifier in
    parentheses is the LDAP display name for the attribute. The acceptable values for this parameter are:

    -- A Distinguished Name
    -- A GUID (objectGUID)
    -- A Security Identifier (objectSid)
    -- A SAM Account Name (sAMAccountName)

    The cmdlet searches the default naming context or partition to find the object. If two or more objects are found,
    the cmdlet returns a non-terminating error.

    This parameter can also get this object through the pipeline or you can set this parameter to an object instance.

    Required?                    true
    Position?                    1
    Default value
    Accept pipeline input?       True (ByValue)
    Accept wildcard characters?  false

您可以尝试 更新 - 帮助 下载最新的PowerShell帮助文件(如果您的服务器已连接到Internet ...)。