Forum Discussion

AB21805's avatar
AB21805
Bronze Contributor
Nov 25, 2022

Removing start up websites on log in

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? 

 

 

  • AB21805 
    This should be the solution:

     

     

     

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

     

     

     

  • 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? 

     

    • AB21805's avatar
      AB21805
      Bronze Contributor
      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
      • Jannik_Reinhard's avatar
        Jannik_Reinhard
        Iron Contributor

        AB21805 
        This should be the solution:

         

         

         

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

         

         

         

Resources