eDecisions Posted August 9, 2020 Posted August 9, 2020 Great for onboarding new station, you can grab any other short cuts such as to shared rive, or network folders, the users C drive or the my documents folder as well, I just did the office apps. Â Â Â #By eDcisions $Officepath = (New-Object -ComObject WScript.Shell).RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Winword.exe\Path") $WshShell = New-Object -comObject WScript.Shell $Shortcut = $WshShell.CreateShortcut("$Home\Desktop\Excel.lnk") $Shortcut.TargetPath = "$Officepath\Excel.exe" $Shortcut.Save() $WshShell = New-Object -comObject WScript.Shell $Shortcut = $WshShell.CreateShortcut("$Home\Desktop\Outlook.lnk") $Shortcut.TargetPath = "$Officepath\Outlook.exe" $Shortcut.Save() $WshShell = New-Object -comObject WScript.Shell $Shortcut = $WshShell.CreateShortcut("$Home\Desktop\Word.lnk") $Shortcut.TargetPath = "$Officepath\Winword.exe" $Shortcut.Save()
eDecisions Posted August 10, 2020 Author Posted August 10, 2020 Darn, missed the fact that I was in session 0, ooops my bad, this should add to all active users. Â $Officepath = (New-Object -ComObject WScript.Shell).RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Winword.exe\Path") $Profiles = Get-ChildItem 'HKLM:\Software\Microsoft\Windows NT\CurrentVersion\ProfileList' | ForEach-Object { $_.GetValue('ProfileImagePath') } foreach ($profile in $profiles -match "Users" -notmatch "spfarm" -notmatch "spsearch" -notmatch "TEMP" -notmatch "Classic"){ $WshShell = New-Object -comObject WScript.Shell $Shortcut = $WshShell.CreateShortcut("$Profile\Desktop\Excel.lnk") $Shortcut.TargetPath = "$Officepath\Excel.exe" $Shortcut.Save() $WshShell = New-Object -comObject WScript.Shell $Shortcut = $WshShell.CreateShortcut("$Profile\Desktop\Outlook.lnk") $Shortcut.TargetPath = "$Officepath\Outlook.exe" $Shortcut.Save() $WshShell = New-Object -comObject WScript.Shell $Shortcut = $WshShell.CreateShortcut("$Profile\Desktop\Word.lnk") $Shortcut.TargetPath = "$Officepath\Winword.exe" $Shortcut.Save() } Â
eDecisions Posted August 12, 2020 Author Posted August 12, 2020 I used a few times now and its about 90%, about 10% of the time my script fails to find the program, if anyone has any thoughts on what I missed please share.
Carl T Posted September 12, 2021 Posted September 12, 2021 About a year late here, but I would advise only worrying about the Public Desktop as this will impact all users who use the workstation. C:\users\public\public desktop\
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now