Solved

AD 2012 Move Atrribute Mobile Phone to Pager

Posted on 2016-07-22
6
64 Views
Last Modified: 2016-08-06
I'm trying migrate AD attributes from Mobile Phone to Pager field for all users accounts. but while running the code below im getting an error.

"A parameter cannot be found that matches parameter name 'pager'"

I have more than 300 users in AD last time it took me 1 day to manually add all the data.


$Users = Get-ADUser -Filter * -Properties MobilePhone,Pager

foreach ($user in $Users){
Set-ADUser -pager $User.mobilephone -whatif -verbose
}

Open in new window


Previous Post
0
Comment
Question by:akosinoah
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 1

Author Comment

by:akosinoah
ID: 41725541
Sorry i linked the old post i made for the same question.
0
 
LVL 1

Expert Comment

by:XcelogiX
ID: 41725554
0
 
LVL 40

Expert Comment

by:footech
ID: 41726517
Just because Set-ADUser doesn't have a parameter for pager doesn't mean it can't modify that attribute.  You can use the -Add, -Replace, -Clear, and -Remove parameters to modify any attributes (that aren't otherwise blocked) by referencing their ldap displayname.
Get-ADUser -Filter * -Properties MobilePhone,Pager | ForEach `
    $user = $_
    $user | Set-ADUser -Add@{pager = "$($user.mobile)"} -whatif -verbose
}

Open in new window

0
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 
LVL 1

Author Comment

by:akosinoah
ID: 41729829
Hi footech will this replicate the data from mobile phone to pager field?
0
 
LVL 40

Accepted Solution

by:
footech earned 500 total points
ID: 41731506
Had a couple syntax errors.  It will copy the data.  It will not clear out the MobilePhone data, but that's easy enough to do later or even add the -Remove parameter to the below.
Get-ADUser -Filter * -Properties MobilePhone,Pager | ForEach `
{
    $user = $_
    $user | Set-ADUser -Add @{pager = "$($user.MobilePhone)"} -whatif -verbose
}

Open in new window

You would need to remove the -whatif parameter to run for real.  As with anything you should test before executing on production users.
0
 
LVL 1

Author Closing Comment

by:akosinoah
ID: 41745181
Thanks
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A project that enables an administrator to perform actions within a user session context not just at the time of login but any time later on day(s) or week(s) later.
Active Directory security has been a hot topic of late, and for good reason. With 90% of the world’s organization using this system to manage access to all parts of their IT infrastructure, knowing how to protect against threats and keep vulnerabil…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question