Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Modify Non-Viewable attributes through Power Shell or Dos commands.

$
0
0

Hi,

I am trying to modifying the below information for existing users using CSV file. Could you help me to do it through Power Shell.

Scenario:

I have 50 Users where I want to modify "Othertelephone" & "info" for those object. These are AD attributes and you can see under respectively: General >> Telephone Number >>Other & Telephone >> Notes.

I want to look users from .csv file and modify above attributes for mentioned users in csv file.

Thanks

Shambhu Sharma

Currently, I have run the below commands which gave me error and come to know using New-ADUser or Set-ADUser I cannot modify as there is no such attributes belong to both commands.

Error:

Set-ADUser : A parameter cannot be found that matches parameter name 'info'.
At C:\altools\Info.ps1:1 char:115
+ Import-CSV "C:\altools\testaccount55.csv" | % { $User = $_.SamAccountName; $Info = $_.Info; Set-adUser $User -info <<
<<   $info }
    + CategoryInfo          : InvalidArgument: (:) [Set-ADUser], ParameterBindingException
    + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.ActiveDirectory.Management.Commands.SetADUser

Otherway:

Set-ADUser : A parameter cannot be found that matches parameter name 'othertelephone'.
At C:\altools\Info.ps1:1 char:107
+ Import-CSV "C:\altools\testaccount55.csv" | % {$User = $_.SamAccountName; Set-adUser $User -othertelephone <<<<  $_.o
thertelephone -info $_.info}
    + CategoryInfo          : InvalidArgument: (:) [Set-ADUser], ParameterBindingException
    + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.ActiveDirectory.Management.Commands.SetADUser

My Script:

Import-CSV "C:\altools\testaccount55.csv" | % {$User = $_.SamAccountName; Set-adUser $User -othertelephone $_.othertelephone -info $_.info}

From my understanding these two attributed are not acceptable from New-ADUser and Set-ADUser Powershellcommand.

I am not sure whether we have any other option to put these do attributes data using the other command but importing the same csv file.


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>