SysManSquad / sysmansquadblog

1 stars 3 forks source link

Trigger Teams Installer for User After Machine Wide Installer-SysManSquad | Systems Management Squad #22

Open utterances-bot opened 1 year ago

utterances-bot commented 1 year ago

Trigger Teams Installer for User After Machine Wide Installer-SysManSquad | Systems Management Squad

A community blog and subsidiary of WinAdmins.io

https://sysmansquad.com/2021/01/26/trigger-teams-installer-for-user-after-machine-wide-installer/

AlSuds commented 1 year ago

This helped me greatly. Thank you so much. Learnt something very valuable today. Without this a reboot would be needed = unhappy users. You saved me some real headaches. Paying it back (hopefully): When we are offboarding a Customer's computers it is useful to search-and-destroy any Scheduled Tasks created by our MSP - so I use the 'Author' field. But to insert 'Author' we cannot use Action, Description, Settings, etc. - we can only do it after the New-ScheduledTask @splat. Here's where I added it within your script: $ScheduledTask = New-ScheduledTask @newScheduledTaskSplat $ScheduledTask.Author = "My_MSP" # adds the Author field, if wanted $ScheduledTask.Settings.DeleteExpiredTaskAfter = "PT0S" Even though the Scheduled Task is automatically removed in the Teams case, I hope you might find the 'Add Author' step useful for any permanent/long-term Scheduled Tasks you might have to manage.