Skip to content

Creating Post Script

Featured Replies

Hello!
I want to run the following command after OneDrive application deployment:

%LocalAppData%\Microsoft\OneDrive\OneDrive.exe /configure_business

Appreciate any assistance!

Elad.
 

Ho do you deploy the application?

Did you wrap it in a script? VBS, bat, PS?

If so, you can easily append that command in the script.

Hi,

If you want the application to be configured for each new user that logs onto the machine and you only want it to occur once per user than Microsoft have something built for this already.

It's called activesetup.

You just add a few registry keys to HKLM. User logs on and it runs whatever is in the stubpath

info

Example

If you run the below code in the ISE as administrator, then log off and back on again IE will load just one time per new user :)

For each new activesetup make sure you make it unique with a new GUID

#requires -Version 1

<#
Author: Richard Knight
Version:1.0

Purpose: Creates Active Setup keys
random GUID created at https://www.guidgenerator.com/
#>

$Appname = 'Name of Application'
$stubpath = 'C:\Program Files (x86)\Internet Explorer\iexplore.exe'

$Reglocation = 'HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{f4d8fb9e-3bce-4152-add4-2f4e5f647610}'
New-Item -Path $Reglocation -Force
New-ItemProperty $Reglocation -Name 'Product' -Value "$Appname"
New-ItemProperty $Reglocation -Name 'StubPath' -Value "$stubpath"
New-ItemProperty $Reglocation -Name 'Version' -Value '1'

 

Here is the .reg if it makes it easier.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\{f4d8fb9e-3bce-4152-add4-2f4e5f647610}]
"Product"="Name of Application"
"StubPath"="C:\\Program Files (x86)\\Internet Explorer\\iexplore.exe"
"Version"="1"

 

  • Author
1 hour ago, dinci5 said:

Ho do you deploy the application?

Did you wrap it in a script? VBS, bat, PS?

If so, you can easily append that command in the script.

Hi dinci5,
Sorry i wasn't clear, I'm deploying the Application via SCCM Application option.

Thanks!
 

  • Author
2 hours ago, Ath3na said:

Here is the .reg if it makes it easier.


Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\{f4d8fb9e-3bce-4152-add4-2f4e5f647610}]
"Product"="Name of Application"
"StubPath"="C:\\Program Files (x86)\\Internet Explorer\\iexplore.exe"
"Version"="1"

 

 

2 hours ago, Ath3na said:

Hi,

If you want the application to be configured for each new user that logs onto the machine and you only want it to occur once per user than Microsoft have something built for this already.

It's called activesetup.

You just add a few registry keys to HKLM. User logs on and it runs whatever is in the stubpath

info

Example

If you run the below code in the ISE as administrator, then log off and back on again IE will load just one time per new user :)

For each new activesetup make sure you make it unique with a new GUID


#requires -Version 1

<#
Author: Richard Knight
Version:1.0

Purpose: Creates Active Setup keys
random GUID created at https://www.guidgenerator.com/
#>

$Appname = 'Name of Application'
$stubpath = 'C:\Program Files (x86)\Internet Explorer\iexplore.exe'

$Reglocation = 'HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{f4d8fb9e-3bce-4152-add4-2f4e5f647610}'
New-Item -Path $Reglocation -Force
New-ItemProperty $Reglocation -Name 'Product' -Value "$Appname"
New-ItemProperty $Reglocation -Name 'StubPath' -Value "$stubpath"
New-ItemProperty $Reglocation -Name 'Version' -Value '1'

 

Thanks!

My question is how do i add such script so it will run after SCCM has successfully installed the Application to a given machine.

Thanks again.

As someone else already mentioned, if you're running a script to perform the installation, just append it to the end of your script.

If you were deploying it as an SCCM Package (instead of an Application), then you could create two packages.  Have Package A install OneNote. Have Package B run your command.  Then use the Run another program first option on Package B, tell it that it has to install Package A, then deploy Package B. 

I'm sure there's an equivalent to that with Applications, but in all honesty I still do far more with packages than applications.  

  • Author
14 hours ago, BryanP said:

As someone else already mentioned, if you're running a script to perform the installation, just append it to the end of your script.

If you were deploying it as an SCCM Package (instead of an Application), then you could create two packages.  Have Package A install OneNote. Have Package B run your command.  Then use the Run another program first option on Package B, tell it that it has to install Package A, then deploy Package B. 

I'm sure there's an equivalent to that with Applications, but in all honesty I still do far more with packages than applications.  

Thank you!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.