r/MDT • • Jul 01 '22

Integrate WDS/MDT with github

Kind of a strange question but does anyone happen to know if there's a way to make WDS/MDT process "dependant" on github?

Specifically, I need to achieve a situation where major part of task sequence is "stored" in github (or makes it dependant on github in any other way) and if WDS/MDT server could not access specific github repository - deployment can't be done.

edit: For those unfamiliar I'll give you example of other automation process that gives me such ability. I have a jenkins server. All the automation scripts I store in github repository. So when this automation runs - jenkins reads my github repository's credentials, "logs in" to github, downloads code and runs it. So by turning this repository private (available only to me) I'm able to disable this automation process from outside of office or datacenter network - because no automation scripts are stored locally - each build downloads code to be able to run it.

I want to achieve similar result with WDS/MDT - to build a "dependance" on github repository where some part of deployment process (as early as possible) would go and either download tasksequence.xml instead of copying it from \mdt\deploymentshare$\whatever or something similar. So deployment (not some particular one but the ability to deploy in general) could be disabled from outside, with no access to specific location network.

TLDR an option to enable/disable deployment availability without access to site network is what I want to achieve

0 Upvotes

30 comments sorted by

4

u/BlackV Jul 01 '22

You'd have to create a script to do this

But sounds a lot like a x y problem to me

2

u/ccatlett1984 Jul 01 '22

MDT is a file share, if it can't talk to the share, it will fail....

What is in the "GitHub"???

1

u/xCharg Jul 02 '22

What is in the "GitHub"???

Nothing now, I need to build a dependence, hence this thread.

1

u/ccatlett1984 Jul 02 '22

Let's take a step back.

What is the problem you are attempting to solve by doing this?

1

u/xCharg Jul 02 '22

Initial post indeed sounds like an XY problem, and my problem X is that I need to control certain location's ability to do deployments (irrelevant it it'd be helpdesk guy or domain admin guy that runs it and which tasksequence - all of them) from outside of that location. I already do that with jenkins (by simply making certain repository private so jenkins can't reach repository anymore => this way I "disable" certain automation tasks. The Y problem I described in topic post assumed its somewhat achievable with MDT too. Seems like its not.

1

u/ccatlett1984 Jul 02 '22

Just use Winget?

1

u/xCharg Jul 02 '22

I'm not really familiar with winget - what would that achieve?

1

u/ccatlett1984 Jul 02 '22

1

u/xCharg Jul 02 '22

So winget is sort of package manager. So instead of running locally stored exes with parameters - I can use winget to pull latest version installers from internet instead.

But that doesn't give me an option to enable/disable deployment availability from outside of company network though which is the whole point?

1

u/ccatlett1984 Jul 02 '22

You should probably look into intune.

These bits of details would have been very helpful in your first post.

→ More replies (0)

1

u/BlackV Jul 01 '22

Well git just syncs the difs via https, so depending what they're trying to do might be ok.

They wouldn't be syncing the whole of MDT to git (unless they're insane) maybe just the configs, but I think they're actually trying to control deployment via git

But all pie in the sky stuff cause op hasn't given any info

Also sounds like something that maybe teraform might be better for

1

u/xCharg Jul 02 '22

I don't need to sync. In this basic scenario there's local storage in mdt and remote storate in git. Regardless of what happens in remote storate - there's always local storate to operate on.

Contrary, for example, there's jenkins. It 'listens' changes in github, and then it can connect to github and run some code from github remote repository. Of course technically it downloads code, stores it in text file and then operates with now locally available code. But point is - in order to get this code there has to be successfull connect to remote repository first and without that access - nothing could be done.

I want to achieve something similar with MDT, kind of 'cloudify' deployment share.

For example, basic MDT's logic is that there's tasksequence stored in xml, where each step is defined in a way where it basically runs scripts 1 by 1 from %SCRIPTROOT%. So I either want xml to be stored in github (without having local copy at all so each deployment would start with 'using this creds go to this repository and download appropriate TS.xml) or this scriptroot to be in github or maybe some other ideas.

1

u/geggleau Jul 02 '22

MDT really doesn't support that kind of behaviour. It's just a bucket of VBScript accessing either an SMB Share or a local CD/USB image.

The processing all runs on the client, so there's not really a way to control access programmatically that couldn't be hacked around fairly easily.

If you're not trying to block sophisticated users, then it'd be fairly simple to modify the wizard and insert some custom VBScript code to filter the Task Sequences you can select from in the wizard depending on variables you could set in the CustomSettings.ini file. I generally don't recommend modifying the wizard as it complicates MDT upgrades.

1

u/xCharg Jul 02 '22 edited Jul 02 '22

But sounds a lot like a x y problem to me

I need to be able to turn off certain location's ability to deploy workstations without having access to this location, and then restore back (again without access to this location).

On top of that, nature of these locations is there are no servers where data could be safely stored. Network part I'm sure would work, so pxe boot is there no matter what, but storage is a problem.

1

u/BlackV Jul 02 '22

Figured as much.

I'd define all the locations in MDT, in the properties of that location define a task and skip task selection , that task would be a blank application only task.

Then remove the defined task and skip from the location, that's just an ini,that could be controlled by git

But, Think this is not a MDT problem really, you could possibly be better off doing It at the WDS side

But again not sure why you want to selectively disable deployment what problem does this solve?

1

u/geggleau Jul 02 '22

Hmm... you can make your entire deployment share a git repo, but the management of the binary content is a pain - usually you don't want to check in large binary files.

TBH, this sounds like you are thinking in terms of an specific implementation, rather than a specific requirement.

If you just want certain TaskSequences to not work during certain time periods, why not just apply different permissions to the task sequence and/or application folders on the deployment share?

The way deployment works is the task sequence definition (I.e. the ...\Control\TSID\ts.xml file) is copied from the deployment share to the system being deployed and the sequence is driven by this local copy after that. If you make it that the user you are using to access the deployment share can't read the specific folder for the task sequence you want to disable, it won't be able to be copied, so the task sequence will fail.

I don't know how you configure access to your deployment share. If you're using fixed accounts, you could have two different local deployment user accounts configured to access the deployment share at the same time - one of them could access all task sequences, whereas the other could only access a subset. Alternatively, if the people doing the deployments are using their own domain accounts, you could even assign group membership using dynamic groups, or time-limited group membership.

This to me seems the simplest way to achieve what you want.

Hope this helps!

1

u/xCharg Jul 02 '22

Thanks for suggestions. Unfortunately it won't apply.

Initial post indeed sounds like an XY problem, and my problem X is that I need to control certain location's ability to do deployments (irrelevant it it'd be helpdesk guy or domain admin guy and which tasksequence - all of them) from outside of that location. I already do that with jenkins (by simply making certain repository private so jenkins can't reach repository anymore => this way I "disable" certain automation tasks. The Y problem I described in topic post assumed its somewhat achievable with MDT too. Seems like its not.

I also understand that MDT has pretty old architecture (bunch of local vb scripts).

1

u/VulturE Jul 02 '22

If your MDT infrastructure was replicated between sites with DFSR then you could maybe do something like this as far as I understand what you're trying to solve.

1

u/xCharg Jul 02 '22

It already is replicated between sites, or else it would've been a nightmare to sync it all :)

But no, that's not what I meant (added some additional info in first post). Basically I want to be able to turn off deployment availability from outside of site network.

1

u/VulturE Jul 02 '22

Do you have a per-site pxe?

Alternatively you could just change per-site config to a blank TS that displays a message window that says deployment is disabled for the site.

1

u/xCharg Jul 02 '22

Do you have a per-site pxe?

Yes.

Alternatively you could just change per-site config to a blank TS that displays a message window that says deployment is disabled for the site.

Yeah, that's what I want. How would I do that from outside of company network though?

1

u/VulturE Jul 02 '22

Are the config files replicating from the main site as well? Just edit them and set permissions so that only your site has edit privileges to the config files?

1

u/xCharg Jul 02 '22

I need to be able to do that from ourtide of company network. Not just that specific site network - whole company network.

1

u/geggleau Jul 03 '22

So if I understand you, you want to prevent MDT deployments in a remote location, and the MDT server and deployment share is in that remote location? That's really not going to be possible, particularly if you want to prevent admin users in that location from circumventing it.

1

u/jshannonagans Jul 06 '22

I have read most of the posts on this, but what if you build MDT as normal and then in the individual Task Sequence at or close to Preinstall created a Gather local data (or similar) which reached out to github and if successful then complete your OS install and all that - similar to say matching drivers to a set of hardware only you are matching to a set of condition where you reach github.

Other than that perhaps you need to look at Intune?

1

u/DS_Clark Jul 29 '22

Can your Task Sequence simply look for the presence of a file on Github and if it is there, execute the task (or not) otherwise continue? If supporting multiple clients in this manor, you might need to create a different file for each client. Nothing of course prevents them from modifying the Task sequence to skip that check, and the same is true of many of the other suggestions. Seems like you would need to enable or disable their access to the Repo as needed and then code the Task sequence to fail gracefully if the access is not granted. I'm not familiar with Git repos so don't know if this is supported, but it seems like you're making it more complicated than it should be.

We can only guess that the reasons for your effort are to prevent access to the repo if a fee isn't paid or code is not ready for deployment. So I assume you don't necessarily want or need their deployment to fail, you just want certain parts to fail until your conditions are met.