check that a specific GPO setting exists for the domain - powershell

Is there a command (or powershell cmd) that I can run that will check a specific GPO setting exists for the domain? For example we need to check that the Guest account in Windows is disabled using GPO.
Thanks

Group Policy is flexible and can apply different settings depending on the user/computer combination, so there is no way to check every single GPO combination in an entire domain.
You can check the settings being applied to a specific user/computer combination using either Group Policy Results and Group Policy Modeling
If your GPO configuration is simple enough you could check every combination, but it's not practically possible on large/complex domains.

Related

How do I create Local Group Policy Objects on a standalone machine?

I have to set up five laptops with four users on the them. Two of these users will need the same permissions on them but are used for different purposes. I use MMC snap-ins to edit permissions of Non-Administrators but I need to create a snap-in for the other two that should have identical settings. I don’t want to have to manually enable settings for both users individually; I would like the users in a Local Group so I can create a Local Group Policy Object with the settings I want applied to them.
Creating a user group in gpedit.msc doesn’t work because the created user group doesn’t appear as an option in the Add Snap-In window and I can’t use Group Policy Management because these are standalone machines - not domain machines.
From what I can tell: you can’t. You have to do your settings for all users individually.

Default permissions come back on AzDevOps queues

On premises AzDevOps Server 2019, version Dev17.M153.5. I have restricted default access rights to agent queues on every single project in every single collection - removed the default set (Release Admins/Build Admins/Project Admins), added some other lines (Server Admins).
Now, ever once in a while, intermittenly with no pattern that I can see, those three permissions keep coming back automagically. On different projects, through no human actions (all the humans who have the rights for that have been told), those three lines with the Administrator role reappear on the default agent queue ACL.
Is that a known behavior in AzDevOps? Any way to opt out?
EDIT: here's what it looks like. The first three lines don't belong.
EDIT: as per the advice, I'd try to track it down using the activity log. I went and made a dummy change to default queue security elsewhere. There was a log record with command SecurityRoleAssignments.SetRoleAssignments. I then filtered the activity log on the collection where the permissions have reverted, and searched for the same command. No instances. The log ends around 7/14, which is likely before the event.
This should be caused by Inheritance permission. By default, the option Inheritance is turned on and the following groups are added to the Administrator role of 'All agent pools': Build Administrators, Release Administrators, Project Administrators.
If we turn off the option Inheritance, we can remove the default permission groups (Release Admins/Build Admins/Project Admins).
If we turn on the Inheritance, the permission group will be inherited again and the default permission groups will come back, please check the option and confirm that inheritance is always off. Please also confirm with all the humans who have the rights to update the option.
Uodate1
Login {Azure DevOps Server URL}/_oi/_diagnostics/activityLog, we can see the Activity Log and check who added the permission groups, please check it.
Installed Azure DevOps 2020. A couple of weeks in, no such behavior.
Concluding it was a bug in AzDevOps 2019 all along that they've quietly fixed.

Copy users and groups

I have been tasked with copying users and groups from one domain to another.
These are two 2012 domains, without a trust. (Prod → model → dev domains). Passwords are not a concern (all will be reset). This will be written in powershell running on a member server of the source domain (if that matters).
My question is, should I
copy all of the groups, then copy the users adding them to the newly created groups as each one is copied, or
copy the users, then create the groups adding the memberships as each group is created, or
copy all the users, then all the groups, then go back thru the users (or groups) to confirm memberships are processed?
My gut leans me to #1, but would #2 be a better option (and is #3 really even a consideration?)
Note: This is not a directory migration. I understand users will have new SID's, and profiles. Rather, this is to set up as identical as I can lab environment.
Create your Users first as no nesting membership concerns. Create your groups and add membership, you can be sure your User membership is correct on this first pass but not nested group membership. Rescan groups for missing (group) membership and record how many groups were modified, repeat until no further modifications are required. Done.
This is basically the strategy you use with Microsoft Active Directory Migration Tool (ADMT).
You could create groups first, but your code would start with groups then users and then back to groups again. Not that this is a necessary a problem.
We did this approach in our test and dev for a while but eventually moved to Veeam Virtual Labs (Isolated Sandbox).

Add registry key for every user from Install4j

Is there any way we can trigger an addition of a registry key for each user that uses the application?
Right now it seems that whatever value I add somewhere in HKEY_CURRENT_USER it will only be added for the user that trigger the installation.
It is not possible to enumerate users. In a large network, there may be very many users and it may not be possible to say which of those are "local" users.

perforce: controlling permissions without involving super user access

We are using perforce in my company and heavily rely on it. I need some suggestion for the following scenario:
Our Depot structure is something like this:
//depot
/product1
/component1
/component2
.
.
/componentN
/*.java
/*.xml
/product2
/component1
/component2
.
.
/componentN
/*.java
/*.xml
Every product has multiple components and every component consist of java or xml or some other program file. Every component has a manager/owner associated with it.
Right now, we have blocked the write permissions for every user and only when it is approved by the manager/owner after code review, we open the write permission for that user for any file/folder to check in. This process becomes a little untidy because the manager/developer have to wait for perforce admin to allow permissions (update protections table of perforce). Also, we give them a window of only 24 hrs to check in (due to agile, which i dont understand much :)), after which we are supposed to block the write access again for that user.
What I am looking for is a mechanism where perforce admins can delegate this responsibility to respective managers/owners without giving them super user or admin access and which automatically disables the write permission after 24 hrs.
Any suggestions ?
Thanks in advance.
There's nothing to do this out of the box, per se.
The closest thing I can think of is if the mainline version of these components were permissioned by a group with an owner. The owner of the group is allowed to add and remove members from the group, thus delegating the permissioning to the "gatekeeper" rather than the admins, themselves.
Let me know if you require further clarification about this.
One common solution is to build a simple tool which reads and writes the protections table, the group memberships, etc., to implement the policies that you desire.
The protections and groups data are not complex in format, and you can easily write a little bit of text-processing code that writes and re-writes these specs according to your needs.
Then install your tool on the server machine in a secure fashion, granting the tool the rights to update the protections table, and have your component administrators use the tool to manage the permissions.
For example, I've seen this done by writing a small web application, in Java or Perl for example, installing that on a web server on a secure machine, and letting the component admins operate that tool through a web interface.
All your tool has to provide is (a) a simple login/logout mechanism for your component admins (the web server may already do this for you), (b) a command that takes a user name and a folder name and grants permission, and (c) a command (or a timer) that removes that permissions subsequently.