Forums
New posts
Search forums
Articles
Latest reviews
Search resources
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Community
Article Discussion
File Change Tripwire
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Regedit32, post: 77476, member: 11152"] This is a great script Ian. Something you might consider including is a function to confirm the User belongs to the Administrative Group. For example: [code]function ConfirmUserIsAdministrator { [CmdletBinding()] Param() ${CmdletName} = $Pscmdlet.MyInvocation.MyCommand.Name ${Identity} = [System.Security.Principal.WindowsIdentity]::GetCurrent() ${Principal} = new-object System.Security.Principal.WindowsPrincipal(${Identity}) ${IsAdmin} = $Principal.IsInRole([System.Security.Principal.WindowsBuiltInRole]::Administrator) if (-not ${IsAdmin}) { Write-Error -Message "${CmdletName}: User is not an administrator. To continue run application as administrator." ` -RecommendedAction "Run application as administrator" ` } else { Write-Host "Scanning selected directory" } } ConfirmUserIsAdministrator # Then your code goes here for the $Event's[/code] [/QUOTE]
Verification
Post reply
Forums
Community
Article Discussion
File Change Tripwire
Top