trondr / fivechecks Goto Github PK
View Code? Open in Web Editor NEWFive checks and a reminder. Notify end user if action is required to keep the computer compliant.
License: Other
Five checks and a reminder. Notify end user if action is required to keep the computer compliant.
License: Other
Documents should be stored in "My Documents". If other files than shortcuts are found on the user desktop, notify the user.
The ExitApplicationMessage is sent by each individual compliance check causing application to exit prematurely.
When machine has been up for N days without restart, show user a notification message.
Warning message in the log: No action registered to action arguments: 'dismiss'.
To remove any personal stamps.
CompliNotifi is short for Compliance Notifications and currently seems to be a unique construct.
Compliance items are measured every hour as a scheduled task and result is serialized to item specific files. Compliance check is done by deserializing the compliance item results. However if non-compliance is detected run a double check by re-executing the measurement manually. If non-compliance is still detected, show a notification to the user. A double check should be run to avoid notifying the user about a out of date non-compliance.
1 hours -> should be 1 hour
1 timer should be 1 time
Computers used infrequently (user turns on briefly and the shuts down) is a challenge to keep updated.
Design an algorithm for detecting infrequent use of the computer. Notify the user to leave the computer on if used infrequently. Computer must be powered on N hours every week. Where N is configurable.
Improve error handling in case domain controller is not reachable.
Running action for one of the notifications closes Compliance.Notifications.exe after action has been run. Compliance.Notifications.exe must be kept running until all notifications has been handled.
Expected behaviour:
If more than one notification is shown (f.example disk space + restart). If user activates the disk cleanup, it should also be possible to activate restart action after cleanup is done. Right now Compliance.Notifications.exe exits after the first action so that the next action is not handled.
Proposed action when detecting Windows Update issues. Start the troubleshooter.
msdt.exe /id WindowsUpdateDiagnostic
Do not use protocol actions as this leaves the application hanging without knowing what happened (did the user eventually click the action button?).
Forground actions will trigger a OnActivated event that can be handled by the application before instructing it self to exit gracefully.
Only run a double check compliance measurement once on the first non-compliance detected. It is not necessary to run the measurements multiple times within the short time periode of the compliance checks. There is very likely no changes between the runs.
Currently there is no debug logging from the internals of the compliance checks.
Exclude filters for non-important pending file rename operations can be used to suppress reboot notifications.
It seems it is not possible to get the command line of a process that was started with admin privileges and the source process is standard user process. Results in the exception when trying to close the "admin" process:
System.ArgumentNullException: Value cannot be null.Parameter name: input at System.Text.RegularExpressions.Regex.Match(String input) at System.Text.RegularExpressions.Regex.Match(String input, String pattern) at Compliance.Notifications.Common.F.StripPathAndArgumentsFromCommandLine(String processName, String commandLine) in E:\Dev\github.trondr\Compliance.Notifications\src\app\Compliance.Notifications\Common\F.cs:line 715 at Compliance.Notifications.Common.F.GetCommandLineWithoutPathAndArguments(Process process) in E:\Dev\github.trondr\Compliance.Notifications\src\app\Compliance.Notifications\Common\F.cs:line 710 at Compliance.Notifications.Common.F.<>c__DisplayClass57_0.b__1(Process p1) in E:\Dev\github.trondr\Compliance.Notifications\src\app\Compliance.Notifications\Common\F.cs:line 679 at System.Linq.Enumerable.WhereSelectArrayIterator2.MoveNext() at System.Linq.Buffer
1..ctor(IEnumerable1 source) at System.Linq.Enumerable.ToArray[TSource](IEnumerable
1 source) at Compliance.Notifications.Common.F.CloseOtherProcessWithSameCommandLine(Process process) in E:\Dev\github.trondr\Compliance.Notifications\src\app\Compliance.Notifications\Common\F.cs:line 676 at Compliance.Notifications.CommandDefinitions.d__2.MoveNext() in E:\Dev\github.trondr\Compliance.Notifications\src\app\Compliance.Notifications\CommandDefinitions.cs:line 46--- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at NCmdLiner.CmdLineryProvider.d__5.MoveNext()--- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at NCmdLiner.CmdLinery.d__23.MoveNext()--- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at NCmdLiner.CmdLinery.d__3.MoveNext()--- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at TryAsyncExtensions.d__76`1.MoveNext()
Define registry settings for controlling compliance notifications.
Create an ADM template manipulating the defined registry settings.
Convert ADM template to ADMX template by using Microsoft ADMX Migrator (https://www.microsoft.com/en-us/download/details.aspx?id=15058)
In a Active Directory Domain deploy ADMX file to \%USERDNSDOMAIN%\sysvol%USERDNSDOMAIN%\Policies\PolicyDefinitions
Notify user a specified number of days in advance if password is about to expire.
Adjust scheduled task to stop the existing instance.
PendingReboot policy ignored. Example:
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\FiveChecks\PendingRebootCheck\PendingFileRenameOperations]ExcludeDeleteTargets
When running disk space check:
System.ArgumentException: Value needs to be positive. ved Compliance.Notifications.Applic.Common.UDecimal..ctor(Decimal value) i E:\Dev\github.trondr\Compliance.Notifications\src\app\Compliance.Notifications\Applic\Common\UDecimal.cs:linje 26 ved Compliance.Notifications.Applic.DiskspaceCheck.CheckDiskSpaceCommand.RequiredCleanupAmount(DiskSpaceInfo spaceInfo, UDecimal requiredFreeDiskSpace, Boolean subtractSccmCache) i E:\Dev\github.trondr\Compliance.Notifications\src\app\Compliance.Notifications\Applic\DiskspaceCheck\CheckDiskSpaceCommand.cs:linje 58 ved Compliance.Notifications.Applic.DiskspaceCheck.CheckDiskSpaceCommand.<>c__DisplayClass1_0.g__IsNonCompliant|0(DiskSpaceInfo spaceInfo) i E:\Dev\github.trondr\Compliance.Notifications\src\app\Compliance.Notifications\Applic\DiskspaceCheck\CheckDiskSpaceCommand.cs:linje 47 ved Compliance.Notifications.Applic.Common.F.d__601.MoveNext() i E:\Dev\github.trondr\Compliance.Notifications\src\app\Compliance.Notifications\Applic\Common\F.cs:linje 661--- Slutt p� stakksporing fra forrige plassering der unntak ble iverksatt --- ved System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() ved System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) ved Compliance.Notifications.Applic.DiskspaceCheck.CheckDiskSpaceCommand.<CheckDiskSpacePure>d__0.MoveNext() i E:\Dev\github.trondr\Compliance.Notifications\src\app\Compliance.Notifications\Applic\DiskspaceCheck\CheckDiskSpaceCommand.cs:linje 28--- Slutt p� stakksporing fra forrige plassering der unntak ble iverksatt --- ved System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() ved System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) ved Compliance.Notifications.Applic.DiskspaceCheck.CheckDiskSpaceCommand.<CheckDiskSpace>d__1.MoveNext() i E:\Dev\github.trondr\Compliance.Notifications\src\app\Compliance.Notifications\Applic\DiskspaceCheck\CheckDiskSpaceCommand.cs:linje 48--- Slutt p� stakksporing fra forrige plassering der unntak ble iverksatt --- ved System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() ved System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) ved Compliance.Notifications.CommandDefinitions.<>c__DisplayClass6_0.<<CheckCompliance>b__0>d.MoveNext() i E:\Dev\github.trondr\Compliance.Notifications\src\app\Compliance.Notifications\CommandDefinitions.cs:linje 117--- Slutt p� stakksporing fra forrige plassering der unntak ble iverksatt --- ved System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() ved System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) ved System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) ved System.Windows.Threading.DispatcherOperation.InvokeImpl() ved MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj) ved System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) ved System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) ved System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) ved MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state) ved System.Windows.Threading.DispatcherOperation.Invoke() ved System.Windows.Threading.Dispatcher.ProcessQueue() ved System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) ved MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) ved MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) ved System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) ved System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) ved System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) ved MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) ved MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) ved System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) ved System.Windows.Application.RunDispatcher(Object ignore) ved System.Windows.Application.RunInternal(Window window) ved Compliance.Notifications.App.RunApplicationOnStart(StartupEventHandler onStart) i E:\Dev\github.trondr\Compliance.Notifications\src\app\Compliance.Notifications\App.xaml.cs:linje 67 ved Compliance.Notifications.CommandDefinitions.<CheckCompliance>d__6.MoveNext() i E:\Dev\github.trondr\Compliance.Notifications\src\app\Compliance.Notifications\CommandDefinitions.cs:linje 128--- Slutt p� stakksporing fra forrige plassering der unntak ble iverksatt --- ved System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() ved System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) ved NCmdLiner.CmdLineryProvider.<Run>d__5.MoveNext()--- Slutt p� stakksporing fra forrige plassering der unntak ble iverksatt --- ved System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() ved System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) ved NCmdLiner.CmdLinery.<Run>d__23.MoveNext()--- Slutt p� stakksporing fra forrige plassering der unntak ble iverksatt --- ved System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() ved System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) ved NCmdLiner.CmdLinery.<Run>d__3.MoveNext()--- Slutt p� stakksporing fra forrige plassering der unntak ble iverksatt --- ved System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() ved System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) ved TryAsyncExtensions.<Try>d__76
1.MoveNext()
Open the standard Windows 10 shutdown dialog by running the vbscript commands:
dim objShell
set objShell = CreateObject("shell.application")
objshell.ShutdownWindows
set objShell = nothing
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.