Remove multiple Active sync device

Addy Nadia
Addy Nadia used Ask the Experts™
on
Hello,

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

i have 500 device ID with me

Thanks,
Andy
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
IT Infrastructure Architect
Commented:
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..
Addy NadiaExpert

Author

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}
Subash SundharanIT Infrastructure Architect

Commented:
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

Should you be charging more for IT Services?

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Addy NadiaExpert

Author

Commented:
is it required to be in 1, 2 , 3 format
or i can put it straight in txt file just all device id
Subash SundharanIT Infrastructure Architect

Commented:
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.
Addy NadiaExpert

Author

Commented:
this is i have put in text file


GUID

----

ApplDQVFW2TSDKPH
ApplDQVK8GH5F193
Subash SundharanIT Infrastructure Architect

Commented:
Remove header information
GUID

 ----

Open in new window

Just keep device ID's in input file
ApplDQVFW2TSDKPH
ApplDQVK8GH5F193

Open in new window

Addy NadiaExpert

Author

Commented:
okie.. i will let you know soon
Addy NadiaExpert

Author

Commented:
i am getting error below

The mobile device ApplDQVFW2TSDKPH cannot be found.
Addy NadiaExpert

Author

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
Subash SundharanIT Infrastructure Architect

Commented:
Yes GUID should work..
Addy NadiaExpert

Author

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
Addy NadiaExpert

Author

Commented:
means GUID will be different for every one, for every device..right
Addy NadiaExpert

Author

Commented:
also i want before removing it will ask for confirm
Subash SundharanIT Infrastructure Architect

Commented:
If you want command to ask for confirmation on each device, then remove -Confirm:$false from code.
Addy NadiaExpert

Author

Commented:
ok thanks.. good support
Addy NadiaExpert

Author

Commented:
Thanks Subsun for Great support
Addy NadiaExpert

Author

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 $_}
Subash SundharanIT Infrastructure Architect

Commented:
Yes, that's correct.. and input file should be in same format which I explained earlier..
Addy NadiaExpert

Author

Commented:
ok thanks
Addy NadiaExpert

Author

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
Subash SundharanIT Infrastructure Architect

Commented:
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

Addy NadiaExpert

Author

Commented:
ok thanks

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial