【问题标题】:Terminal Services Profile Path终端服务配置文件路径
【发布时间】:2017-12-19 05:54:00
【问题描述】:

我正在编写一个 powershell 脚本来提取我们活动目录中用户的漫游配置文件路径。但是我收到以下错误消息

$ADUser = Get-ADUser nstark | Select -ExpandProperty DistinguishedName
$ADUser = [ADSI]”LDAP://$ADUser”
$RoamingProfilePath = $ADUser.psbase.InvokeGet(“terminalservicesprofilepath”)

方法调用失败,因为 [System.Management.Automation.PSInternalMemberSet] 不包含 名为“InvokeGet”的方法。在行:1 字符:1 + $ADUser.psbase.InvokeGet(“终端服务配置文件路径”) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~ + CategoryInfo : InvalidOperation: (InvokeGet:String) [], RuntimeException + FullyQualifiedErrorId : MethodNotFound

我不知道如何解决这个问题,也不知道为什么要开始

【问题讨论】:

    标签: powershell active-directory


    【解决方案1】:

    我认为您可以从 Active Directory 中获取此信息。不是叫ProfilePath

    Get-ADUser nstark -Properties ProfilePath
    

    如果您想通过 ADSI 获得它,psbase 上没有称为 InvokeGet 的方法。你可以这样称呼它:

    $ADUser = Get-ADUser nstark | Select -ExpandProperty DistinguishedName
    $ADUser = [ADSI]”LDAP://$ADUser”
    $RoamingProfilePath = $ADUser.InvokeGet(“terminalservicesprofilepath”)
    

    【讨论】:

    • 对不起,我花了这么长时间才接受你的回答 ProfilePath 确实是我需要的
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-06-13
    • 2016-11-10
    • 2013-10-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-12-25
    相关资源
    最近更新 更多