Rasmus Tved
-
Posts
3 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by Rasmus Tved
-
-
Hi,
I have expanded a bit on this small script, both to do some error handeling and do some logging of changes made.
I have this running on my instace multiple times a day. Hope this can help someone.Â
#Check if eventlog source is already created, if not then create if (![System.Diagnostics.EventLog]::SourceExists("Pulseway Scripting")){ New-EventLog -LogName Application -Source "Pulseway Scripting" } #Set username to blank $username = '' #Set username to actual username $username = $(Get-WMIObject -class Win32_ComputerSystem | select username).username $usernamev2 = (((query user)[1]).TrimStart()).SubString(0,21) #Combine username and text $usertext = "| $username" #Fall back to alternative user information if first is empty if($usertext -eq "| ") { $usertext = "| $usernamev2" } #Collect current value $curvalue = $(Get-ItemProperty "HKLM:\SOFTWARE\MMSOFT Design\PC Monitor\" -Name ComputerName).Computername #Check that there is a username If ($usertext -ne "| ") { #Collect computername $computername = $env:COMPUTERNAME #Combine username and text $pulsewayname = "$computername $usertext" #Check that current value is not the same as the new one if ($curvalue -ne $pulsewayname) { #Set the new value Set-ItemProperty "HKLM:\SOFTWARE\MMSOFT Design\PC Monitor\" -Name ComputerName -Value $pulsewayname #Write the changes to event log Write-EventLog -LogName Application -Source "Pulseway Scripting" -EventId 1000 -EntryType Information -Message ` "Event: Pulseway Computername Updated Current user: $username Computername: $computername Changed from: $curvalue Changed to: $pulsewayname " } }
Â
-
Hi,Â
Have you tried this:Â https://intercom.help/pulseway/en/articles/5488944-oauth2-0-for-microsoft-o365-with-psa-email-parserÂ
I have just setup a email parser here and it seems to work.Â
Enable monitoring of active network adapter
in PowerShell
Posted
I have created this small script to enable monitoring of the active network adapter on a given machine. Hope this can be of some help for others in the forum.Â
Â