附加到AD用户帐户描述属性 [英] Append to AD User Account Description Property

查看:68
本文介绍了附加到AD用户帐户描述属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何将此信息纳入下面的脚本中。我需要将AD用户帐户的描述属性

How do I incoroporate this into the script below. I need to Append/Add to the AD User Accounts' description property

附加/添加到 (Dor-Get-Date-IEM)标记为禁用。

flagged for disablement with (Dor-Get-Date-IEM).

#My Script

cls

导入模块activedirectory

$ 90days =(获取日期).AddDays(-90)

$ filepath =" C:\Temp \Dormant_Report _ $(Get-Date -Format yyyyMMddmm).csv"
$
$ splatter = @ {

    过滤= {

          enabled -eq $ True

          -and lastlogondate -le $ 90days                     


          -and(employeeType -like'E'-or employeetype -like'C'  -or employeetype -like'X'-or employeetype -like'A'-or employeetype -like'N')

      }
      Property = @(

                 'name',

                 'SurName',

                 'givenName',

                 'description',

                  'employeeType',

                  'employeeID',

                  'extensionAttribute15',

          &NBS磷;        'lastlogondate',

                  'passwordlastset'

                )

}

$ results = Get-ADUser @splatter

$ results | Export-Csv $ filepath -NoTypeInformation

$ results |禁用-ADAccount -Whatif

#My Script
cls
Import-module activedirectory
$90days = (get-date).AddDays(-90)
$filepath="C:\Temp\Dormant_Report_$(Get-Date -Format yyyyMMddmm).csv"
$splatter=@{
     Filter={
          enabled -eq $True
          -and lastlogondate -le $90days                      
          -and (employeeType -like 'E' -or employeetype -like 'C'  -or employeetype -like 'X' -or employeetype -like 'A' -or employeetype -like 'N')
      }
      Property=@(
                  'name',
                  'SurName',
                  'givenName',
                  'description',
                  'employeeType',
                  'employeeID',
                  'extensionAttribute15',
                  'lastlogondate',
                  'passwordlastset'
                )
}
$results=Get-ADUser @splatter
$results | Export-Csv $filepath -NoTypeInformation
$results | Disable-ADAccount -Whatif

推荐答案

不确定你的意思......你是不是想要使用特定值更新用户的描述属性?您的

Not sure what you mean...are you attempting to just update the user's description attribute with a specific value? Is your


结果变量是否高于引用用户集合而不仅仅是单个用户?如果是这样,我会这样做:
results variable above referring to a collection of users and not just a single user? If so, here's how I would do it:


newValue = "描述属性的更新值"
newValue = "Updated value for Description attribute"


这篇关于附加到AD用户帐户描述属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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