Powershell Exchange Delete old Phone Sync DevicesExporting specific fields with powershell's export-csvPowershell: Wanting Exchange statistics and running into (output) limitationsPowershell script to delete secondary SMTP addresses of Exchange 2010 Mail Contacts(Powershell) Method to return a list of groups where a specific user has 'write member' securityPowershell pipe exporting to csv is loosing dataPowershell Script to output all Distribution groups and nested groups into a csvHow to receive email notification of non-AD joined DHCP leases?Powrshell Script to read the Windows Secutiry logs and filter Elevation type 196 and 1937Powershell List Users who have RDS User CalError while running powershell script to back up DNS Zones

Can a human be transformed into a Mind Flayer?

How can I deal with uncomfortable silence from my partner?

What is the purpose of bonds within an investment portfolio?

Proving that a Russian cryptographic standard is too structured

Understanding "Current Draw" in terms of "Ohm's Law"

Why did Intel abandon unified CPU cache?

With Ubuntu 18.04, how can I have a hot corner that locks the computer?

color rows on table (Tabu package)

Generate basis elements of the Steenrod algebra

Is there a set of positive integers of density 1 which contains no infinite arithmetic progression?

Russian word for a male zebra

The Frozen Wastes

Excel division by 0 error when trying to average results of formulas

What is this airplane?

Why was this person allowed to become Grand Maester?

Advantages of the Exponential Family: why should we study it and use it?

Is this a bug in plotting step functions?

How to “listen” to existing circuit

Why Does Mama Coco Look Old After Going to the Other World?

How do free-speech protections in the United States apply in public to corporate misrepresentations?

I have a problematic assistant manager, but I can't fire him

Teaching a class likely meant to inflate the GPA of student athletes

Is it possible to have a wealthy country without a middle class?

Return a String containing only alphabets without spaces



Powershell Exchange Delete old Phone Sync Devices


Exporting specific fields with powershell's export-csvPowershell: Wanting Exchange statistics and running into (output) limitationsPowershell script to delete secondary SMTP addresses of Exchange 2010 Mail Contacts(Powershell) Method to return a list of groups where a specific user has 'write member' securityPowershell pipe exporting to csv is loosing dataPowershell Script to output all Distribution groups and nested groups into a csvHow to receive email notification of non-AD joined DHCP leases?Powrshell Script to read the Windows Secutiry logs and filter Elevation type 196 and 1937Powershell List Users who have RDS User CalError while running powershell script to back up DNS Zones






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








1















I'm trying to run a Powershell Script that will clean up any Phones that haven't synced in at least 110 days with the Exchange 2013 Server.



My code will pull the data and export it to CSV but when I try to pipe in the Remove-MobileDevice command to delete the devices the script fails to do so. Nothing I found on the Internet has been of much help so far. Most are using the outdated ActiveSyncDevice cmdlets.



Here's my code, I'm new to PowerShell and appreciate any help:



Get-MobileDevice -result unlimited | Get-MobileDeviceStatistics | where $_.LastSuccessSync -le (Get-Date).AddDays(“-110”) | select devicetype, deviceidentity, deviceos, deviceuseragent, identity | Export-csv C:PhoneSyncLogsStale_Devices_110days_$((Get-Date).ToString('MM-dd-yyyy_hh-mm-ss')).csv | foreach (Remove-MobileDevice -Identity DeviceUserAgent -confirm:$false)









share|improve this question













migrated from stackoverflow.com Mar 23 '17 at 14:13


This question came from our site for professional and enthusiast programmers.


















  • One issue is that you are attempting pipe to your final foreach after exporting your csv. Probably worth while to break your one-liner into an a multiple line script for clarity.

    – BenH
    Jan 18 '17 at 18:52











  • Did you inspect the CSV file?

    – Jeroen Heier
    Jan 18 '17 at 18:58











  • I tried removing the export and it still bombs out with this error: The mobile device DeviceUserAgent cannot be found. + CategoryInfo : NotSpecified: (:) [Remove-MobileDevice], ManagementObjectNotFoundException + FullyQualifiedErrorId : [Server=WEBMAIL,RequestId=771c3306-817b-4049-a076-e398d73fbaed,TimeStamp=1/18/2017 6:59:23 PM] [FailureCategory=Cmdlet -ManagementObjectNotFoundException] DFB3D711,Microsoft.Exchange.Management.Tasks.RemoveMobileDevice + PSComputerName : webmail.server.com

    – djl236
    Jan 18 '17 at 19:00











  • Yes, the CSV contains the device I want deleted.

    – djl236
    Jan 18 '17 at 19:02











  • That issue is because foreach object you are passing you are statically defining the Identity as "DeviceUserAgent" with this: -Identity DeviceUserAgent Try changing it to -Identity $_.DeviceUserAgent.

    – BenH
    Jan 18 '17 at 21:34

















1















I'm trying to run a Powershell Script that will clean up any Phones that haven't synced in at least 110 days with the Exchange 2013 Server.



My code will pull the data and export it to CSV but when I try to pipe in the Remove-MobileDevice command to delete the devices the script fails to do so. Nothing I found on the Internet has been of much help so far. Most are using the outdated ActiveSyncDevice cmdlets.



Here's my code, I'm new to PowerShell and appreciate any help:



Get-MobileDevice -result unlimited | Get-MobileDeviceStatistics | where $_.LastSuccessSync -le (Get-Date).AddDays(“-110”) | select devicetype, deviceidentity, deviceos, deviceuseragent, identity | Export-csv C:PhoneSyncLogsStale_Devices_110days_$((Get-Date).ToString('MM-dd-yyyy_hh-mm-ss')).csv | foreach (Remove-MobileDevice -Identity DeviceUserAgent -confirm:$false)









share|improve this question













migrated from stackoverflow.com Mar 23 '17 at 14:13


This question came from our site for professional and enthusiast programmers.


















  • One issue is that you are attempting pipe to your final foreach after exporting your csv. Probably worth while to break your one-liner into an a multiple line script for clarity.

    – BenH
    Jan 18 '17 at 18:52











  • Did you inspect the CSV file?

    – Jeroen Heier
    Jan 18 '17 at 18:58











  • I tried removing the export and it still bombs out with this error: The mobile device DeviceUserAgent cannot be found. + CategoryInfo : NotSpecified: (:) [Remove-MobileDevice], ManagementObjectNotFoundException + FullyQualifiedErrorId : [Server=WEBMAIL,RequestId=771c3306-817b-4049-a076-e398d73fbaed,TimeStamp=1/18/2017 6:59:23 PM] [FailureCategory=Cmdlet -ManagementObjectNotFoundException] DFB3D711,Microsoft.Exchange.Management.Tasks.RemoveMobileDevice + PSComputerName : webmail.server.com

    – djl236
    Jan 18 '17 at 19:00











  • Yes, the CSV contains the device I want deleted.

    – djl236
    Jan 18 '17 at 19:02











  • That issue is because foreach object you are passing you are statically defining the Identity as "DeviceUserAgent" with this: -Identity DeviceUserAgent Try changing it to -Identity $_.DeviceUserAgent.

    – BenH
    Jan 18 '17 at 21:34













1












1








1








I'm trying to run a Powershell Script that will clean up any Phones that haven't synced in at least 110 days with the Exchange 2013 Server.



My code will pull the data and export it to CSV but when I try to pipe in the Remove-MobileDevice command to delete the devices the script fails to do so. Nothing I found on the Internet has been of much help so far. Most are using the outdated ActiveSyncDevice cmdlets.



Here's my code, I'm new to PowerShell and appreciate any help:



Get-MobileDevice -result unlimited | Get-MobileDeviceStatistics | where $_.LastSuccessSync -le (Get-Date).AddDays(“-110”) | select devicetype, deviceidentity, deviceos, deviceuseragent, identity | Export-csv C:PhoneSyncLogsStale_Devices_110days_$((Get-Date).ToString('MM-dd-yyyy_hh-mm-ss')).csv | foreach (Remove-MobileDevice -Identity DeviceUserAgent -confirm:$false)









share|improve this question














I'm trying to run a Powershell Script that will clean up any Phones that haven't synced in at least 110 days with the Exchange 2013 Server.



My code will pull the data and export it to CSV but when I try to pipe in the Remove-MobileDevice command to delete the devices the script fails to do so. Nothing I found on the Internet has been of much help so far. Most are using the outdated ActiveSyncDevice cmdlets.



Here's my code, I'm new to PowerShell and appreciate any help:



Get-MobileDevice -result unlimited | Get-MobileDeviceStatistics | where $_.LastSuccessSync -le (Get-Date).AddDays(“-110”) | select devicetype, deviceidentity, deviceos, deviceuseragent, identity | Export-csv C:PhoneSyncLogsStale_Devices_110days_$((Get-Date).ToString('MM-dd-yyyy_hh-mm-ss')).csv | foreach (Remove-MobileDevice -Identity DeviceUserAgent -confirm:$false)






powershell






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 18 '17 at 18:37







djl236











migrated from stackoverflow.com Mar 23 '17 at 14:13


This question came from our site for professional and enthusiast programmers.









migrated from stackoverflow.com Mar 23 '17 at 14:13


This question came from our site for professional and enthusiast programmers.














  • One issue is that you are attempting pipe to your final foreach after exporting your csv. Probably worth while to break your one-liner into an a multiple line script for clarity.

    – BenH
    Jan 18 '17 at 18:52











  • Did you inspect the CSV file?

    – Jeroen Heier
    Jan 18 '17 at 18:58











  • I tried removing the export and it still bombs out with this error: The mobile device DeviceUserAgent cannot be found. + CategoryInfo : NotSpecified: (:) [Remove-MobileDevice], ManagementObjectNotFoundException + FullyQualifiedErrorId : [Server=WEBMAIL,RequestId=771c3306-817b-4049-a076-e398d73fbaed,TimeStamp=1/18/2017 6:59:23 PM] [FailureCategory=Cmdlet -ManagementObjectNotFoundException] DFB3D711,Microsoft.Exchange.Management.Tasks.RemoveMobileDevice + PSComputerName : webmail.server.com

    – djl236
    Jan 18 '17 at 19:00











  • Yes, the CSV contains the device I want deleted.

    – djl236
    Jan 18 '17 at 19:02











  • That issue is because foreach object you are passing you are statically defining the Identity as "DeviceUserAgent" with this: -Identity DeviceUserAgent Try changing it to -Identity $_.DeviceUserAgent.

    – BenH
    Jan 18 '17 at 21:34

















  • One issue is that you are attempting pipe to your final foreach after exporting your csv. Probably worth while to break your one-liner into an a multiple line script for clarity.

    – BenH
    Jan 18 '17 at 18:52











  • Did you inspect the CSV file?

    – Jeroen Heier
    Jan 18 '17 at 18:58











  • I tried removing the export and it still bombs out with this error: The mobile device DeviceUserAgent cannot be found. + CategoryInfo : NotSpecified: (:) [Remove-MobileDevice], ManagementObjectNotFoundException + FullyQualifiedErrorId : [Server=WEBMAIL,RequestId=771c3306-817b-4049-a076-e398d73fbaed,TimeStamp=1/18/2017 6:59:23 PM] [FailureCategory=Cmdlet -ManagementObjectNotFoundException] DFB3D711,Microsoft.Exchange.Management.Tasks.RemoveMobileDevice + PSComputerName : webmail.server.com

    – djl236
    Jan 18 '17 at 19:00











  • Yes, the CSV contains the device I want deleted.

    – djl236
    Jan 18 '17 at 19:02











  • That issue is because foreach object you are passing you are statically defining the Identity as "DeviceUserAgent" with this: -Identity DeviceUserAgent Try changing it to -Identity $_.DeviceUserAgent.

    – BenH
    Jan 18 '17 at 21:34
















One issue is that you are attempting pipe to your final foreach after exporting your csv. Probably worth while to break your one-liner into an a multiple line script for clarity.

– BenH
Jan 18 '17 at 18:52





One issue is that you are attempting pipe to your final foreach after exporting your csv. Probably worth while to break your one-liner into an a multiple line script for clarity.

– BenH
Jan 18 '17 at 18:52













Did you inspect the CSV file?

– Jeroen Heier
Jan 18 '17 at 18:58





Did you inspect the CSV file?

– Jeroen Heier
Jan 18 '17 at 18:58













I tried removing the export and it still bombs out with this error: The mobile device DeviceUserAgent cannot be found. + CategoryInfo : NotSpecified: (:) [Remove-MobileDevice], ManagementObjectNotFoundException + FullyQualifiedErrorId : [Server=WEBMAIL,RequestId=771c3306-817b-4049-a076-e398d73fbaed,TimeStamp=1/18/2017 6:59:23 PM] [FailureCategory=Cmdlet -ManagementObjectNotFoundException] DFB3D711,Microsoft.Exchange.Management.Tasks.RemoveMobileDevice + PSComputerName : webmail.server.com

– djl236
Jan 18 '17 at 19:00





I tried removing the export and it still bombs out with this error: The mobile device DeviceUserAgent cannot be found. + CategoryInfo : NotSpecified: (:) [Remove-MobileDevice], ManagementObjectNotFoundException + FullyQualifiedErrorId : [Server=WEBMAIL,RequestId=771c3306-817b-4049-a076-e398d73fbaed,TimeStamp=1/18/2017 6:59:23 PM] [FailureCategory=Cmdlet -ManagementObjectNotFoundException] DFB3D711,Microsoft.Exchange.Management.Tasks.RemoveMobileDevice + PSComputerName : webmail.server.com

– djl236
Jan 18 '17 at 19:00













Yes, the CSV contains the device I want deleted.

– djl236
Jan 18 '17 at 19:02





Yes, the CSV contains the device I want deleted.

– djl236
Jan 18 '17 at 19:02













That issue is because foreach object you are passing you are statically defining the Identity as "DeviceUserAgent" with this: -Identity DeviceUserAgent Try changing it to -Identity $_.DeviceUserAgent.

– BenH
Jan 18 '17 at 21:34





That issue is because foreach object you are passing you are statically defining the Identity as "DeviceUserAgent" with this: -Identity DeviceUserAgent Try changing it to -Identity $_.DeviceUserAgent.

– BenH
Jan 18 '17 at 21:34










1 Answer
1






active

oldest

votes


















0














Can I provide a better (automatically) solution which is build into Exchange? Since Exchange 2013/2016 Microsoft added the EasMaxInactivityForDeviceCleanup value to the throttling policy and described it here as:




The EasMaxInactivityForDeviceCleanup parameter specifies the length of
time that a user's device partnerships will remain active. By default,
there is no limit to the number of days that a user's device
partnerships will remain active. Use this value if you want to
minimize the amount of inactive device partnerships in your
organization. To use this setting, specify a value in days since the
user's last sync time to cause the device partnership to be removed.




So if I would be you, I would create a new throttling policy as explained here and assign that to your users. After that is in place and if a user is adding a new device, the Exchange server will check the configured devices and will automatically delete the unused one, during the adding from the new device. Then you do not need to run a script, the server will mostly take care of them automatically.






share|improve this answer























  • Thank you for that solution, which will be great going forward, but what about the devices there now? I'd like to get this script working to purge them. EDIT: It says this cmdlet is only available on Ex2016, we are using 2013.

    – djl236
    Jan 18 '17 at 19:56











  • I personally would wait as you said you are a new to powershell. I personally wouldn´t risk to delete any administration/monitoring devices if you haven´t the needed skills yet. The point is, how often did the user get new "toys" to play with? I would wait here. But if you really need a script you can check the one in the URL above (or here is it again).

    – BastianW
    Jan 18 '17 at 19:59











  • Its policy from management. Its currently done manually by hand by logging into each user's mailbox. I'm just trying to automate the process. The problem with the script in your URL is when I try to add exporting the results to CSV it fails.

    – djl236
    Jan 18 '17 at 20:02











  • lol someone who doesn't know scripting. I use VBScript a lot more and am just getting into PowerShell so still getting a hang for the syntax and what not. Thanks for the link.

    – djl236
    Jan 18 '17 at 20:12











Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "2"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f840172%2fpowershell-exchange-delete-old-phone-sync-devices%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown
























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














Can I provide a better (automatically) solution which is build into Exchange? Since Exchange 2013/2016 Microsoft added the EasMaxInactivityForDeviceCleanup value to the throttling policy and described it here as:




The EasMaxInactivityForDeviceCleanup parameter specifies the length of
time that a user's device partnerships will remain active. By default,
there is no limit to the number of days that a user's device
partnerships will remain active. Use this value if you want to
minimize the amount of inactive device partnerships in your
organization. To use this setting, specify a value in days since the
user's last sync time to cause the device partnership to be removed.




So if I would be you, I would create a new throttling policy as explained here and assign that to your users. After that is in place and if a user is adding a new device, the Exchange server will check the configured devices and will automatically delete the unused one, during the adding from the new device. Then you do not need to run a script, the server will mostly take care of them automatically.






share|improve this answer























  • Thank you for that solution, which will be great going forward, but what about the devices there now? I'd like to get this script working to purge them. EDIT: It says this cmdlet is only available on Ex2016, we are using 2013.

    – djl236
    Jan 18 '17 at 19:56











  • I personally would wait as you said you are a new to powershell. I personally wouldn´t risk to delete any administration/monitoring devices if you haven´t the needed skills yet. The point is, how often did the user get new "toys" to play with? I would wait here. But if you really need a script you can check the one in the URL above (or here is it again).

    – BastianW
    Jan 18 '17 at 19:59











  • Its policy from management. Its currently done manually by hand by logging into each user's mailbox. I'm just trying to automate the process. The problem with the script in your URL is when I try to add exporting the results to CSV it fails.

    – djl236
    Jan 18 '17 at 20:02











  • lol someone who doesn't know scripting. I use VBScript a lot more and am just getting into PowerShell so still getting a hang for the syntax and what not. Thanks for the link.

    – djl236
    Jan 18 '17 at 20:12















0














Can I provide a better (automatically) solution which is build into Exchange? Since Exchange 2013/2016 Microsoft added the EasMaxInactivityForDeviceCleanup value to the throttling policy and described it here as:




The EasMaxInactivityForDeviceCleanup parameter specifies the length of
time that a user's device partnerships will remain active. By default,
there is no limit to the number of days that a user's device
partnerships will remain active. Use this value if you want to
minimize the amount of inactive device partnerships in your
organization. To use this setting, specify a value in days since the
user's last sync time to cause the device partnership to be removed.




So if I would be you, I would create a new throttling policy as explained here and assign that to your users. After that is in place and if a user is adding a new device, the Exchange server will check the configured devices and will automatically delete the unused one, during the adding from the new device. Then you do not need to run a script, the server will mostly take care of them automatically.






share|improve this answer























  • Thank you for that solution, which will be great going forward, but what about the devices there now? I'd like to get this script working to purge them. EDIT: It says this cmdlet is only available on Ex2016, we are using 2013.

    – djl236
    Jan 18 '17 at 19:56











  • I personally would wait as you said you are a new to powershell. I personally wouldn´t risk to delete any administration/monitoring devices if you haven´t the needed skills yet. The point is, how often did the user get new "toys" to play with? I would wait here. But if you really need a script you can check the one in the URL above (or here is it again).

    – BastianW
    Jan 18 '17 at 19:59











  • Its policy from management. Its currently done manually by hand by logging into each user's mailbox. I'm just trying to automate the process. The problem with the script in your URL is when I try to add exporting the results to CSV it fails.

    – djl236
    Jan 18 '17 at 20:02











  • lol someone who doesn't know scripting. I use VBScript a lot more and am just getting into PowerShell so still getting a hang for the syntax and what not. Thanks for the link.

    – djl236
    Jan 18 '17 at 20:12













0












0








0







Can I provide a better (automatically) solution which is build into Exchange? Since Exchange 2013/2016 Microsoft added the EasMaxInactivityForDeviceCleanup value to the throttling policy and described it here as:




The EasMaxInactivityForDeviceCleanup parameter specifies the length of
time that a user's device partnerships will remain active. By default,
there is no limit to the number of days that a user's device
partnerships will remain active. Use this value if you want to
minimize the amount of inactive device partnerships in your
organization. To use this setting, specify a value in days since the
user's last sync time to cause the device partnership to be removed.




So if I would be you, I would create a new throttling policy as explained here and assign that to your users. After that is in place and if a user is adding a new device, the Exchange server will check the configured devices and will automatically delete the unused one, during the adding from the new device. Then you do not need to run a script, the server will mostly take care of them automatically.






share|improve this answer













Can I provide a better (automatically) solution which is build into Exchange? Since Exchange 2013/2016 Microsoft added the EasMaxInactivityForDeviceCleanup value to the throttling policy and described it here as:




The EasMaxInactivityForDeviceCleanup parameter specifies the length of
time that a user's device partnerships will remain active. By default,
there is no limit to the number of days that a user's device
partnerships will remain active. Use this value if you want to
minimize the amount of inactive device partnerships in your
organization. To use this setting, specify a value in days since the
user's last sync time to cause the device partnership to be removed.




So if I would be you, I would create a new throttling policy as explained here and assign that to your users. After that is in place and if a user is adding a new device, the Exchange server will check the configured devices and will automatically delete the unused one, during the adding from the new device. Then you do not need to run a script, the server will mostly take care of them automatically.







share|improve this answer












share|improve this answer



share|improve this answer










answered Jan 18 '17 at 19:53









BastianWBastianW

2,68341533




2,68341533












  • Thank you for that solution, which will be great going forward, but what about the devices there now? I'd like to get this script working to purge them. EDIT: It says this cmdlet is only available on Ex2016, we are using 2013.

    – djl236
    Jan 18 '17 at 19:56











  • I personally would wait as you said you are a new to powershell. I personally wouldn´t risk to delete any administration/monitoring devices if you haven´t the needed skills yet. The point is, how often did the user get new "toys" to play with? I would wait here. But if you really need a script you can check the one in the URL above (or here is it again).

    – BastianW
    Jan 18 '17 at 19:59











  • Its policy from management. Its currently done manually by hand by logging into each user's mailbox. I'm just trying to automate the process. The problem with the script in your URL is when I try to add exporting the results to CSV it fails.

    – djl236
    Jan 18 '17 at 20:02











  • lol someone who doesn't know scripting. I use VBScript a lot more and am just getting into PowerShell so still getting a hang for the syntax and what not. Thanks for the link.

    – djl236
    Jan 18 '17 at 20:12

















  • Thank you for that solution, which will be great going forward, but what about the devices there now? I'd like to get this script working to purge them. EDIT: It says this cmdlet is only available on Ex2016, we are using 2013.

    – djl236
    Jan 18 '17 at 19:56











  • I personally would wait as you said you are a new to powershell. I personally wouldn´t risk to delete any administration/monitoring devices if you haven´t the needed skills yet. The point is, how often did the user get new "toys" to play with? I would wait here. But if you really need a script you can check the one in the URL above (or here is it again).

    – BastianW
    Jan 18 '17 at 19:59











  • Its policy from management. Its currently done manually by hand by logging into each user's mailbox. I'm just trying to automate the process. The problem with the script in your URL is when I try to add exporting the results to CSV it fails.

    – djl236
    Jan 18 '17 at 20:02











  • lol someone who doesn't know scripting. I use VBScript a lot more and am just getting into PowerShell so still getting a hang for the syntax and what not. Thanks for the link.

    – djl236
    Jan 18 '17 at 20:12
















Thank you for that solution, which will be great going forward, but what about the devices there now? I'd like to get this script working to purge them. EDIT: It says this cmdlet is only available on Ex2016, we are using 2013.

– djl236
Jan 18 '17 at 19:56





Thank you for that solution, which will be great going forward, but what about the devices there now? I'd like to get this script working to purge them. EDIT: It says this cmdlet is only available on Ex2016, we are using 2013.

– djl236
Jan 18 '17 at 19:56













I personally would wait as you said you are a new to powershell. I personally wouldn´t risk to delete any administration/monitoring devices if you haven´t the needed skills yet. The point is, how often did the user get new "toys" to play with? I would wait here. But if you really need a script you can check the one in the URL above (or here is it again).

– BastianW
Jan 18 '17 at 19:59





I personally would wait as you said you are a new to powershell. I personally wouldn´t risk to delete any administration/monitoring devices if you haven´t the needed skills yet. The point is, how often did the user get new "toys" to play with? I would wait here. But if you really need a script you can check the one in the URL above (or here is it again).

– BastianW
Jan 18 '17 at 19:59













Its policy from management. Its currently done manually by hand by logging into each user's mailbox. I'm just trying to automate the process. The problem with the script in your URL is when I try to add exporting the results to CSV it fails.

– djl236
Jan 18 '17 at 20:02





Its policy from management. Its currently done manually by hand by logging into each user's mailbox. I'm just trying to automate the process. The problem with the script in your URL is when I try to add exporting the results to CSV it fails.

– djl236
Jan 18 '17 at 20:02













lol someone who doesn't know scripting. I use VBScript a lot more and am just getting into PowerShell so still getting a hang for the syntax and what not. Thanks for the link.

– djl236
Jan 18 '17 at 20:12





lol someone who doesn't know scripting. I use VBScript a lot more and am just getting into PowerShell so still getting a hang for the syntax and what not. Thanks for the link.

– djl236
Jan 18 '17 at 20:12

















draft saved

draft discarded
















































Thanks for contributing an answer to Server Fault!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f840172%2fpowershell-exchange-delete-old-phone-sync-devices%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Wikipedia:Vital articles Мазмуну Biography - Өмүр баян Philosophy and psychology - Философия жана психология Religion - Дин Social sciences - Коомдук илимдер Language and literature - Тил жана адабият Science - Илим Technology - Технология Arts and recreation - Искусство жана эс алуу History and geography - Тарых жана география Навигация менюсу

Bruxelas-Capital Índice Historia | Composición | Situación lingüística | Clima | Cidades irmandadas | Notas | Véxase tamén | Menú de navegacióneO uso das linguas en Bruxelas e a situación do neerlandés"Rexión de Bruxelas Capital"o orixinalSitio da rexiónPáxina de Bruselas no sitio da Oficina de Promoción Turística de Valonia e BruxelasMapa Interactivo da Rexión de Bruxelas-CapitaleeWorldCat332144929079854441105155190212ID28008674080552-90000 0001 0666 3698n94104302ID540940339365017018237

What should I write in an apology letter, since I have decided not to join a company after accepting an offer letterShould I keep looking after accepting a job offer?What should I do when I've been verbally told I would get an offer letter, but still haven't gotten one after 4 weeks?Do I accept an offer from a company that I am not likely to join?New job hasn't confirmed starting date and I want to give current employer as much notice as possibleHow should I address my manager in my resignation letter?HR delayed background verification, now jobless as resignedNo email communication after accepting a formal written offer. How should I phrase the call?What should I do if after receiving a verbal offer letter I am informed that my written job offer is put on hold due to some internal issues?Should I inform the current employer that I am about to resign within 1-2 weeks since I have signed the offer letter and waiting for visa?What company will do, if I send their offer letter to another company