Jump to content

Recommended Posts

Posted

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

Posted

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


}
 

Posted

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.

  • 1 year later...
Posted

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\

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...