Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retire Application Doesn't work #15

Open
PaulKlerkx opened this issue Dec 1, 2020 · 1 comment
Open

Retire Application Doesn't work #15

PaulKlerkx opened this issue Dec 1, 2020 · 1 comment

Comments

@PaulKlerkx
Copy link

Hi, if the application is retired, then the script sets to active to deal with it, it doesn't retire it at the end.

@PaulKlerkx
Copy link
Author

this appears to work instead - remove the commented lines and replace with the "suspend-..." line

retire the app

        if (!$RetiringApp.IsExpired) {
        	Suspend-CMApplication -Name "Retired-$app"
            # $appWMI = gwmi -Namespace Root\SMS\Site_$(Get-PSDrive -PSProvider CMSite) -class SMS_ApplicationLatest -Filter "LocalizedDisplayName = 'Retired-$app'"
            # $appWMI.SetIsExpired($true) # | Out-Null
           Update-Log "Set status to Retired.`n"
        } else {
           Update-Log "Status was already set to Retired.`n"
        }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant