Remove multiple Active sync device

Hello,

Could any one suggets, how i can remove the Active sync device from Exchange,.

i have 500 device ID with me

Thanks,
Andy
LVL 5
Addy NadiaExpertAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

SubsunCommented:
Try with one device..
Remove-MobileDevice -Identity DeviceIDofphone -Confirm:$false

Open in new window


If it works you can use following code to remove bulk devices.
GC C:\input.txt | %{Remove-MobileDevice -Identity $_ -Confirm:$false}

Open in new window

For exchange 2010 use Remove-ActiveSyncDevice command..
1

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Addy NadiaExpertAuthor Commented:
what is GC in this command and is this i need to run in powershell with txt having all device id information ?

GC C:\input.txt | %{Remove-MobileDevice -Identity $_ -Confirm:$false}
0
SubsunCommented:
You need to run the command EMS (Exchange Management Shell).

GC is the alias for Get-Content, which reads the input details from text file C:\input.txt. The input file should have the device ID's listed in following format.
MobiledeviceID1
MobiledeviceID2
MobiledeviceID3

Open in new window

0
Hey MSSPs! What's your total cost of ownership?

WEBINAR: Managed security service providers often deploy & manage products from a variety of solution vendors. But is this really the best approach when it comes to saving time AND money? Join us on Aug. 15th to learn how you can improve your total cost of ownership today!

Addy NadiaExpertAuthor Commented:
is it required to be in 1, 2 , 3 format
or i can put it straight in txt file just all device id
0
SubsunCommented:
Yes, You can put all device ID's in text file (one device ID per line), it needs not to be in particular order.. I just posted an example.. If you are still confused, post a sample of your input file.
0
Addy NadiaExpertAuthor Commented:
this is i have put in text file


GUID

----

ApplDQVFW2TSDKPH
ApplDQVK8GH5F193
0
SubsunCommented:
Remove header information
GUID

 ----

Open in new window

Just keep device ID's in input file
ApplDQVFW2TSDKPH
ApplDQVK8GH5F193

Open in new window

0
Addy NadiaExpertAuthor Commented:
okie.. i will let you know soon
0
Addy NadiaExpertAuthor Commented:
i am getting error below

The mobile device ApplDQVFW2TSDKPH cannot be found.
0
Addy NadiaExpertAuthor Commented:
can i give GUID in place of Device id ??

i mean it will cause any issue. because first i am testing on two user, then i need to do on 500 users
0
SubsunCommented:
Yes GUID should work..
0
Addy NadiaExpertAuthor Commented:
when i run the same with mentioned GUID of devices, it successfully run

so it is correct or we need to mention Device id only
0
Addy NadiaExpertAuthor Commented:
means GUID will be different for every one, for every device..right
0
Addy NadiaExpertAuthor Commented:
also i want before removing it will ask for confirm
0
SubsunCommented:
If you want command to ask for confirmation on each device, then remove -Confirm:$false from code.
0
Addy NadiaExpertAuthor Commented:
ok thanks.. good support
0
Addy NadiaExpertAuthor Commented:
Thanks Subsun for Great support
0
Addy NadiaExpertAuthor Commented:
if we remove  -Confirm:$false  from command .. so it would be below.. please confirm

GC "c:\My Documents\StaleActiveSyncDevices\devicelist.csv" | %{Remove-MobileDevice -Identity $_}
0
SubsunCommented:
Yes, that's correct.. and input file should be in same format which I explained earlier..
0
Addy NadiaExpertAuthor Commented:
ok thanks
0
Addy NadiaExpertAuthor Commented:
Hello,

Please suggest, if this command is also OK and not having any impact for user

GC "c:\My Documents\StaleActiveSyncDevices\devicelist.csv" | Get-MobileDevice | Remove-MobileDevice

i ran this and found no issue.. so this is OK ?

Thanks
0
SubsunCommented:
Yes, it will work but might be slower..
Directly pipe the GC result to Remove-MobileDevice, it should work bit faster..
GC "c:\My Documents\StaleActiveSyncDevices\devicelist.csv" | Remove-MobileDevice

Open in new window

0
Addy NadiaExpertAuthor Commented:
ok thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Powershell

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.