Jump to content

p_ern

Members
  • Content count

    21
  • Joined

  • Last visited

Community Reputation

1 Neutral

My Information

  • Agent Count
    < 500 Agents

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. p_ern

    Script to debloat win10

    I am using this code with some apps whitelisted. It wouldn't be too hard to add a All Users Scope on it. We are also using a startmenu Layout xml and a script to mount it on all new users. If you have Office 2016 installed it will add those to the pinned list. File added also for the layout Import-StartLayout -LayoutPath "C:\Windows\startlayout-W10-1709.xml" -MountPath C:/ Decrapify Windows 10 - Dynamic. # Functions function Write-LogEntry { param( [parameter(Mandatory=$true, HelpMessage="Value added to the RemovedApps.log file.")] [ValidateNotNullOrEmpty()] [string]$Value, [parameter(Mandatory=$false, HelpMessage="Name of the log file that the entry will written to.")] [ValidateNotNullOrEmpty()] [string]$FileName = "RemovedApps.log" ) # Determine log file location $LogFilePath = Join-Path -Path $env:windir -ChildPath "Temp\$($FileName)" # Add value to log file try { Out-File -InputObject $Value -Append -NoClobber -Encoding Default -FilePath $LogFilePath -ErrorAction Stop } catch [System.Exception] { Write-Warning -Message "Unable to append log entry to RemovedApps.log file" } } # Get a list of all apps Write-LogEntry -Value "Starting built-in AppxPackage, AppxProvisioningPackage and Feature on Demand V2 removal process" $AppArrayList = Get-AppxPackage -PackageTypeFilter Bundle -AllUsers | Select-Object -Property Name, PackageFullName | Sort-Object -Property Name # White list of appx packages to keep installed $WhiteListedApps = @( "Microsoft.DesktopAppInstaller", "Microsoft.Messaging", "Microsoft.MSPaint", "Microsoft.Windows.Photos", "Microsoft.StorePurchaseApp", "Microsoft.MicrosoftStickyNotes", "Microsoft.WindowsAlarms", "Microsoft.WindowsCalculator", "Microsoft.WindowsSoundRecorder", "Microsoft.WindowsStore", "Microsoft.ZuneMusic", "Microsoft.ZuneVideo", "Microsoft.WindowsMaps" ) # Loop through the list of appx packages foreach ($App in $AppArrayList) { # If application name not in appx package white list, remove AppxPackage and AppxProvisioningPackage if (($App.Name -in $WhiteListedApps)) { Write-LogEntry -Value "Skipping excluded application package: $($App.Name)" } else { # Gather package names $AppPackageFullName = Get-AppxPackage -Name $App.Name | Select-Object -ExpandProperty PackageFullName -First 1 $AppProvisioningPackageName = Get-AppxProvisionedPackage -Online | Where-Object { $_.DisplayName -like $App.Name } | Select-Object -ExpandProperty PackageName -First 1 # Attempt to remove AppxPackage if ($AppPackageFullName -ne $null) { try { Write-LogEntry -Value "Removing AppxPackage: $($AppPackageFullName)" Remove-AppxPackage -Package $AppPackageFullName -ErrorAction Stop | Out-Null } catch [System.Exception] { Write-LogEntry -Value "Removing AppxPackage '$($AppPackageFullName)' failed: $($_.Exception.Message)" } } else { Write-LogEntry -Value "Unable to locate AppxPackage: $($AppPackageFullName)" } # Attempt to remove AppxProvisioningPackage if ($AppProvisioningPackageName -ne $null) { try { Write-LogEntry -Value "Removing AppxProvisioningPackage: $($AppProvisioningPackageName)" Remove-AppxProvisionedPackage -PackageName $AppProvisioningPackageName -Online -ErrorAction Stop | Out-Null } catch [System.Exception] { Write-LogEntry -Value "Removing AppxProvisioningPackage '$($AppProvisioningPackageName)' failed: $($_.Exception.Message)" } } else { Write-LogEntry -Value "Unable to locate AppxProvisioningPackage: $($AppProvisioningPackageName)" } } } # White list of Features On Demand V2 packages Write-LogEntry -Value "Starting Features on Demand V2 removal process" $WhiteListOnDemand = "NetFX3|Tools.Graphics.DirectX|Tools.DeveloperMode.Core|Language|Browser.InternetExplorer|ContactSupport|OneCoreUAP|Media.WindowsMediaPlayer" # Get Features On Demand that should be removed try { $OSBuildNumber = Get-WmiObject -Class "Win32_OperatingSystem" | Select-Object -ExpandProperty BuildNumber # Handle cmdlet limitations for older OS builds if ($OSBuildNumber -le "16299") { $OnDemandFeatures = Get-WindowsCapability -Online -ErrorAction Stop | Where-Object { $_.Name -notmatch $WhiteListOnDemand -and $_.State -like "Installed"} | Select-Object -ExpandProperty Name } else { $OnDemandFeatures = Get-WindowsCapability -Online -LimitAccess -ErrorAction Stop | Where-Object { $_.Name -notmatch $WhiteListOnDemand -and $_.State -like "Installed"} | Select-Object -ExpandProperty Name } foreach ($Feature in $OnDemandFeatures) { try { Write-LogEntry -Value "Removing Feature on Demand V2 package: $($Feature)" # Handle cmdlet limitations for older OS builds if ($OSBuildNumber -le "16299") { Get-WindowsCapability -Online -ErrorAction Stop | Where-Object { $_.Name -like $Feature } | Remove-WindowsCapability -Online -ErrorAction Stop | Out-Null } else { Get-WindowsCapability -Online -LimitAccess -ErrorAction Stop | Where-Object { $_.Name -like $Feature } | Remove-WindowsCapability -Online -ErrorAction Stop | Out-Null } } catch [System.Exception] { Write-LogEntry -Value "Removing Feature on Demand V2 package failed: $($_.Exception.Message)" } } } catch [System.Exception] { Write-LogEntry -Value "Attempting to list Feature on Demand V2 packages failed: $($_.Exception.Message)" } # Complete Write-LogEntry -Value "Completed built-in AppxPackage, AppxProvisioningPackage and Feature on Demand V2 removal process" startlayout-W10-1709.xml
  2. p_ern

    Script to debloat win10

    Mgreen is correct on that issue. Its per user sadly.
  3. p_ern

    Automate: New Network Map???

    @RDeBok Thanks for the info
  4. p_ern

    Automate: New Network Map???

    Sounds awesome, any screenshots we might be able too see? Or some footage of the demo?
  5. p_ern

    Scripted Diagram

    New script added: https://github.com/PatrikErn/Labtech_Diagram/tree/master/NetworkDrives Takes exported csv from plugin Map Drives . Makes a diagram on it , to troubleshoot or whatever your fancy is. Test it out.
  6. p_ern

    Show Group Memberships

    Hi , it is still there Try Automation ( COG) -> Effective Policy. You can also search "groups" if you press Begin , and you will see it as a result in Datatiles : Effetcive Policy ->Groups
  7. p_ern

    Disk Space Monitors

    You can run it once on a agent, or make it a monitor. If you check the built in monitors, under configuration , for example the "DRV - Free Space Remaining < 10% Total Size" - monitor you can set the interval and target. Running a script on specific agents, right click and find your script. There you can set it to run once and with intervals. See if that get you near your result. If you can, read up on the documentation on how to make monitors, run scripts and schedule them. https://docs.connectwise.com/ConnectWise_Automate/ConnectWise_Automate_Documentation/070/240/030 Hope that helps.
  8. p_ern

    Disk Space Monitors

    @TomBain Yes, https://docs.connectwise.com/ConnectWise_Automate/ConnectWise_Automate_Documentation/070/240/080
  9. p_ern

    Grafana and Labtech

    @NeonBlueHDD Hi , I would recommend that you redo your Grafana installation since ShawnSack´s instruction was before Grafana Labs included the mysql-datasource as part of their package. Heres the official documentation : http://docs.grafana.org/installation/debian/ You can try to upgrade your current , to the latest version. On to connection issues: Try to get your service running: sudo service grafana-server start Make Grafana start up after reboot: To configure the Grafana server to start at boot time: sudo update-rc.d grafana-server defaults Start the server (via systemd) To start the service using systemd: systemctl daemon-reload systemctl start grafana-server systemctl status grafana-server Enable the systemd service so that Grafana starts at boot. sudo systemctl enable grafana-server.service Make sure when you have installed everything official you use these settings. Datasources settings: Name : Whatever you like | Make default Type: MySQL MySQL Connection Host: your.server.ip.here:3306 Database: labtech | Important, since thats the database where Automate stores everything. User: A user account in Automate | Recommend something with only read permissions.| Remember that Automate user names are Case-Sensitive Password: No need to explain that one Hope that helps
  10. p_ern

    Scripted Diagram

    Updated description: Features: Graph a picture of your current Client and Computers inventory with corresponding locations. It gives an overview on Memory Total , IP-Address, Router Address , and domain. Server will be marked with red double boxes. If a device is not in a domain, and in WORKGROUP its box will be green. Right now it draws the topology from top to bottom. You can change that easily by @{rankdir='TB'} to LR for left to right. To change Layout entirely: Change Hierarchical to Radial , Circular, Springmodel(Small](Medium)(Large) }| Export-PSGraph -ShowGraph -LayoutEngine Hierarchical Preparing your data: Pull data from ConnectWise Automate Data view : Network Make sure you have following columns : ComputerID,Agent Windows Domain,Client Name,Agent Name,Location Name,LocationID,Agent IP Address,Agent Router Address,Agent Type,Agent Memory Total,Agent Mainboard,Agent Serial Number,Agent Operating System,Agent OS Version,Agent MAC Export as csv , remove spaces from Client Name , Location Name and Agent Name.
  11. p_ern

    Scripted Diagram

    Hello all fellow geekers. I´ve scripted a sort of automated diagram , with the help of a Powershell module made by Kevin Marquette. This was made as a way to learn Powershell and as a proof of concept for myself that it can be done. So if its a bit crude and unrefined, thats why. You also need graphviz for this to work.Follow the instructions on Kevins Github on how to install. It consist of two parts , The script itself and a csv. The data is pulled from a dataview with certain columns. I feel like it is ready enough to release for you folks to see if we can improve upon it. I have it on my Github here with instructions on how to use it. Enjoy!
  12. p_ern

    Grafana and Labtech

    Request / Question: Been trying to figure out a good way to monitor Virtual Manager from Grafana. For example : I would like to get CPU percentage per core as a graph. Same with Memory usage. Anyone got an idea? Right now I solved this with following Table: JSON: { "columns": [], "datasource": null, "fontSize": "100%", "gridPos": { "h": 8, "w": 12, "x": 12, "y": 0 }, "id": 3, "links": [], "pageSize": null, "scroll": true, "showHeader": true, "sort": { "col": 6, "desc": true }, "styles": [ { "alias": "Time", "dateFormat": "YYYY-MM-DD HH:mm:ss", "pattern": "time_sec", "type": "hidden", "unit": "percent" }, { "alias": "", "colorMode": null, "colors": [ "rgba(245, 54, 54, 0.9)", "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)" ], "decimals": 2, "pattern": "DeviceName", "thresholds": [], "type": "string", "unit": "short" }, { "alias": "CPU MHZ Total", "colorMode": "cell", "colors": [ "#0a437c", "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)" ], "dateFormat": "YYYY-MM-DD HH:mm:ss", "decimals": 0, "pattern": "TotalCPU", "thresholds": [], "type": "number", "unit": "none" }, { "alias": "CPU Usage MHz", "colorMode": "cell", "colors": [ "#447ebc", "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)" ], "dateFormat": "YYYY-MM-DD HH:mm:ss", "decimals": 0, "pattern": "OverallCPUUsage", "thresholds": [], "type": "number", "unit": "none" }, { "alias": "", "colorMode": "cell", "colors": [ "rgba(245, 54, 54, 0.9)", "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)" ], "dateFormat": "YYYY-MM-DD HH:mm:ss", "decimals": 1, "pattern": "CPU Free %", "thresholds": [ "5", "10" ], "type": "number", "unit": "percent" }, { "alias": "", "colorMode": "cell", "colors": [ "#614d93", "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)" ], "dateFormat": "YYYY-MM-DD HH:mm:ss", "decimals": 2, "pattern": "TotalRAM", "thresholds": [], "type": "number", "unit": "decmbytes" }, { "alias": "RAM Used MB", "colorMode": "cell", "colors": [ "#d683ce", "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)" ], "dateFormat": "YYYY-MM-DD HH:mm:ss", "decimals": 2, "pattern": "OverallMemoryUsage", "thresholds": [], "type": "number", "unit": "decmbytes" }, { "alias": "", "colorMode": "cell", "colors": [ "rgba(245, 54, 54, 0.9)", "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)" ], "dateFormat": "YYYY-MM-DD HH:mm:ss", "decimals": 1, "pattern": "RAM Free %", "thresholds": [ "5", "20" ], "type": "number", "unit": "percent" } ], "targets": [ { "alias": "", "format": "table", "rawSql": "SELECT \r\n(UNIX_TIMESTAMP(LastupDate)) as time_sec,\r\nDeviceName ,\r\n(CPUGhz *1000 *NumberCores) AS TotalCPU ,\r\nOverallCPUUsage,\r\n(CPUGhz *1000*NumberCores -OverallCPUUsage) / (CPUGhz *1000*NumberCores) *100 AS \"CPU Free %\",\r\n\r\nRAMmb AS TotalRAM,\r\nOverallMemoryUsage,\r\n(RAMmb - OverallMemoryUsage ) / RAMmb *100 AS \"RAM Free %\"\r\nFROM \r\nplugin_vm_esxhosts\r\n\r\nGroup BY Devicename", "refId": "A" } ], "title": "Average ESX Host CPU / RAM Last 24H", "transform": "table", "type": "table" } That gives me a general view based on latest data, but no historical values. Heres the SQL: SELECT (UNIX_TIMESTAMP(LastupDate)) as time_sec, DeviceName , (CPUGhz *1000 *NumberCores) AS TotalCPU , OverallCPUUsage, (CPUGhz *1000*NumberCores -OverallCPUUsage) / (CPUGhz *1000*NumberCores) *100 AS "CPU Free %", RAMmb AS TotalRAM, OverallMemoryUsage, (RAMmb - OverallMemoryUsage ) / RAMmb *100 AS "RAM Free %" FROM plugin_vm_esxhosts Group BY Devicename
  13. I use this one , separated by servers / workstations. Client Server Workstation XYZ 5 60 SELECT clientname AS 'Client', SUM(computerisserver=1) AS 'Server', SUM(Computerisserver=0) AS 'Workstation' FROM v_xr_computers GROUP BY clientname ASC
  14. p_ern

    Grafana and Labtech

    Nice layout .
  15. p_ern

    Grafana and Labtech

    Updated the snippets Dashboard - Which is my "playground" for testing out queries and so forth. Cleaned up some code , Added multistat . You can find it here Made performance graphs so it filters on clients ( No need to hard code every server)
×