Jump to content


HaikoH

SiteServer and/or DP Hostname in a Task Sequence

Recommended Posts

Hello Guys!

 

I've got a question for you: How can I use the hostname of the SiteServer as a variable in a TaskSequence?

 

Background: I want to build tasksequences, that copy a specific file from a server via UNC on the SiteServer and I want to have this TaskSequence independent from the specific installation (i.e. export and import it on a different server)

 

Thanks!

 

BR,

Haiko

Share this post


Link to post
Share on other sites

Might be a stupid question, but why do you want to use a UNC path for this? The file is located on the DP, correct? So why not just place the file in a folder, referance that folder when you create a package and use %~dp0 when you are going to copy the file?

 

Example:

  • Make a folder on your main sccm-server (i.e: E:\Sources\Applications\MyApp\<Version>)
  • Inside of that folder you you create a new folder contaning the files you want copied
  • make a bat-file in the root-folder that says something like:

xcopy "%~dp0FolderWithFilesIwantToCopy" "C:\Temp\Example\MyDestination" /C /R /H /K /Y /I /S
:: %~dp0 contains the running dir path, so you can use it no matter what distribution point the client got the package from
:: Other stuff you might want to do...

  • Make a new package in SCCM, and referance the above folder in "this pacakge contains sources files" in the first window of the wizard. But use UNC (\\myserver\Sources\Applications\MyApp\<Version>), remember to share your "sources" folder first
  • In the program window choose the bat file

 

Basic example if incase you are new, otherwise pardon me for boring you :)

Share this post


Link to post
Share on other sites

I don't understand why you would need the severname, care to explain?

 

To be clear: the UNC path (with servername) that you define when you make a package is only the source location. SCCM wil make a package out of the files in the folder and distribute that package to other DPs, so the source location won't really be used in deployments.

Share this post


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.

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.

Loading...


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.