Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Blog post - Permanent WMI Event Handling #51

Closed
wants to merge 5 commits into from
Closed

New Blog post - Permanent WMI Event Handling #51

wants to merge 5 commits into from

Conversation

doctordns
Copy link
Contributor

@doctordns doctordns commented Apr 28, 2021

PR Summary

PR Checklist

  • Do you want this post to be published on a specific date?: Y/N [Specify date]:
  • I have read the contributors guide and followed the style and process guidelines
  • PR has a meaningful title
  • Includes content related an open issue
  • This PR is ready to merge and is not Work in Progress

@doctordns doctordns requested a review from sdwheeler May 2, 2021 15:58
Copy link
Contributor

@sdwheeler sdwheeler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my comments and suggestions. Call me in Teams if you have questions.

Comment on lines +13 to +14
## WMI
Windows Management Instrumentation (WMI) is an important component of the Windows operating system.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## WMI
Windows Management Instrumentation (WMI) is an important component of the Windows operating system.
## WMI
Windows Management Instrumentation (WMI) is an important component of the Windows operating system.

Comment on lines +28 to +31
And for some more details on using WMI and Powershell, look at using PowerShell 7 and WMI, look at [my recently published PowerShell 7 book](https://www.wiley.com/en-gb/PowerShell+7+for+IT+Professionals-p-9781119644705).
In chapter 9, I devote a chapter to WMI and using the CIM cmdlets.
To see just the scripts for that chapter, see my [GitHub repository](https://github.com/doctordns/Wiley20/tree/master/09%20-%20WMI).
The scripts show you the basics of WMI and PowerShell 7.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One of the tenets of this blog is that we don't allow marketing. I am OK with linking to your book, in the right context. See my suggestion at the bottom of the article. I think it reads better there and comes off like a pitch for your book.

Suggested change
And for some more details on using WMI and Powershell, look at using PowerShell 7 and WMI, look at [my recently published PowerShell 7 book](https://www.wiley.com/en-gb/PowerShell+7+for+IT+Professionals-p-9781119644705).
In chapter 9, I devote a chapter to WMI and using the CIM cmdlets.
To see just the scripts for that chapter, see my [GitHub repository](https://github.com/doctordns/Wiley20/tree/master/09%20-%20WMI).
The scripts show you the basics of WMI and PowerShell 7.


In writing this article, I assume you have an understanding of WMI.
In specific, I assume you understand WMI namespaces, classes, properties, and methods.
If not, you might like to look at the [WMI Documentation](https://docs.microsoft.com/windows/win32/wmisdk/wmi-start-page)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
If not, you might like to look at the [WMI Documentation](https://docs.microsoft.com/windows/win32/wmisdk/wmi-start-page)
If not, you might like to look at the [WMI Documentation](https://docs.microsoft.com/windows/win32/wmisdk/wmi-start-page).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will add the full stop.

Comment on lines +89 to +90
This script displays a list of the current members of the Enterprise Admins group to a log file and reports whether the membership now contains unauthorised users.
If the script finds that an unauthorised user is now a group member, it writes details to a text file for you to review later.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This script displays a list of the current members of the Enterprise Admins group to a log file and reports whether the membership now contains unauthorised users.
If the script finds that an unauthorised user is now a group member, it writes details to a text file for you to review later.
This script displays a list of the current members of the **Enterprise Admins** group to a log file and reports whether the membership now contains unauthorized users.
If the script finds that an unauthorized user is now a group member, it writes details to a text file for you to review later.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will revise for American English

Comment on lines +99 to +100
In this post, you want to detect whether an unauthorised user is a member of the Enterprise Admins group.
You must first create a file of authorised users.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In this post, you want to detect whether an unauthorised user is a member of the Enterprise Admins group.
You must first create a file of authorised users.
In this post, you want to detect whether an unauthorized user is a member of the **Enterprise Admins** group.
You must first create a file of authorized users.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will update for US english

Comment on lines +342 to +343

# 11. Tidying up
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# 11. Tidying up
# 11. Tidying up

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed blank line.

Comment on lines +350 to +351
Remove-ADGroupMember @RGMHT

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Remove-ADGroupMember @RGMHT
Remove-ADGroupMember @RGMHT

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed blank line

Comment on lines +237 to +239
Then it looks to see if the Enterprise Admins group contains unauthorised users - and if so, the script reports that fact to the log file.
This script is fairly simple, and you can embellish. as needed.
You could, for example, remove all unauthorised users.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Then it looks to see if the Enterprise Admins group contains unauthorised users - and if so, the script reports that fact to the log file.
This script is fairly simple, and you can embellish. as needed.
You could, for example, remove all unauthorised users.
Then it looks to see if the Enterprise Admins group contains unauthorized users - and if so, the script reports that fact to the log file.
This script is fairly simple, and you can embellish. as needed.
You could, for example, remove all unauthorized users.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed to US ENglish


WMI eventing is very powerful and straightforward to implement.
There are thousands of WMI events you could subscribe to and which may help troubleshooting activities.
In this case, you are examining unauthorised changers to an AD group.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In this case, you are examining unauthorised changers to an AD group.
In this case, you are examining unauthorized changers to an AD group.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Posts/2021/04/tfl-WMIEventHandler.md Show resolved Hide resolved
@doctordns doctordns closed this May 7, 2021
@doctordns doctordns deleted the WMIEvent1 branch May 7, 2021 09:07
@doctordns
Copy link
Contributor Author

This post is being moved into a new folder since it'll be posted in MAY!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants