PowerShell的用户搜索卫生组织帐户到期的办公信息 [英] Powershell-search for users whos account expires with the office information

查看:125
本文介绍了PowerShell的用户搜索卫生组织帐户到期的办公信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁能告诉我如何使用PowerShell来检索广告infor关于用户提供从办公领域的信息卫生组织帐户到期。

Can anyone tell me how to use powershell to retrieve AD infor about users whos account expires with the info from the Office field.

像这个名称,办公,EXPIREDATE

Like this Name, Office, Expiredate

和如何将它从useraccount发送服务器上登录。

And how to send it from the useraccount logged in on the server.

BTW:QADuser是不是一种选择

BTW: QADuser is not an option.

推荐答案

试试这个:

foreach ($user in (gwmi -namespace "root/directory/ldap" -class "ds_user"))
{
    write " `
        $user.DS_name, `
        $user.DS_physicalDeliveryOfficeName,
        (w32tm /ntte $user.DS_accountExpires) `
        " `
    | Out-File ".\userlist.txt" -Append -Encoding ASCII;
}

这篇关于PowerShell的用户搜索卫生组织帐户到期的办公信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆