Jump to content

Office Shortcuts to users Desktop


Recommended Posts

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()

Link to post
Share on other sites

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()


}
 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...