SOLVED

Removing start up websites on log in

Bronze Contributor

Hi all, 

 

I was wondering if you can help me I have set up a website to start up on log in via script 

 

Script: 

 

param(
[string]$ShortcutName = "Bromcom",
[string]$ShortcutUrl = "https://cloudmis.bromcom.com/Nucleus/Framework/Login.aspx",
[string]$ShortcutIconLocation = "1544681534/Bromcom+use.ico"
)

$WScriptShell = New-Object -ComObject WScript.Shell

$Shortcut = $WScriptShell.CreateShortcut("$env:ALLUSERSPROFILE\Microsoft\Windows\Start Menu\Programs\Startup\$ShortcutName.lnk")
$Shortcut.TargetPath = $ShortcutUrl
if ($ShortcutIconLocation) {
$Shortcut.IconLocation = $ShortcutIconLocation
}
$Shortcut.Save()

 

 

How do I get it to remove remotely via intune or script? 

 

 

4 Replies

@AB21805  You can deploy a Powershell script or and endpoint analytics remediation script to remove this script on the local device. Is it triggered via an schedule task? 

Jannik_Reinhard_0-1669396584214.png

 

Yes I have deployed a script however I am unsure on what the script would be if I wanted to remove the website I set to start up at log on
best response confirmed by AB21805 (Bronze Contributor)
Solution

@AB21805 
This should be the solution:

 

 

 

$ShortcutName = "Bromcom"
Remove-Item -Path "$($env:ALLUSERSPROFILE)\Microsoft\Windows\Start Menu\Programs\Startup\$ShortcutName.lnk"

 

 

 

Hi,

Just out of curiosity, why would I use Powershell script over endpoint analytics remediation scrip or vice versa?
1 best response

Accepted Solutions
best response confirmed by AB21805 (Bronze Contributor)
Solution

@AB21805 
This should be the solution:

 

 

 

$ShortcutName = "Bromcom"
Remove-Item -Path "$($env:ALLUSERSPROFILE)\Microsoft\Windows\Start Menu\Programs\Startup\$ShortcutName.lnk"

 

 

 

View solution in original post