charlesnru / updates-automation Goto Github PK
View Code? Open in Web Editor NEWA set of scripts related to the automation of software updates for WSUS and MEMCM
License: GNU General Public License v3.0
A set of scripts related to the automation of software updates for WSUS and MEMCM
License: GNU General Public License v3.0
Hi ,
how can i import only computer groups and not all Approvals xml ?
Hello, please find attached a diff for a very simplicistic implementation of local dependent "All Computers" group name.
My powershell skills are far to waek to implement something more sophisticated, like checking WSUS or current locale.
So it's a simple config extension...
`--- /home/gharry-bsd/Downloads/tmp-share/Invoke-WSUSImportExportManager.ps1 2020-08-31 07:32:59.053029000 +0200
+++ /home/gharry-bsd/Downloads/tmp-share/Invoke-WSUSImportExportManager.new.ps1 2020-08-31 11:11:13.317294651 +0200
@@ -1344,7 +1344,7 @@
[void]$WSUSXMLConfigRoot.AppendChild($WSUSXMLComputerGroups)
$allComputersGroup = $WSUSServer.GetComputerTargetGroups() | Where-Object {$_.name -eq "All Computers"}
$allComputersGroup = $WSUSServer.GetComputerTargetGroups() | Where-Object {$_.name -eq $allComputersGroupName}
$allComputersGroupElement = $WSUSXMLConfig.CreateElement("ComputerGroup")
$allComputersGroupElement.InnerText = $($allComputersGroup.Name)
@@ -1852,15 +1852,15 @@
if($computerGroups){
[System.Xml.XmlElement]$allComputersGroupElement = $computerGroups.ComputerGroup
$allComputersGroupName = "All Computers"
# Defined via config file due to local dependency: $allComputersGroupName = "All Computers"
#Verify that the first computer group is "All Computers"
if($($allComputersGroupElement.'#text') -eq $allComputersGroupName){
$subGroups = $allComputersGroupElement.ComputerGroup
$allComputersGroup = $WSUSServer.GetComputerTargetGroups() | Where-Object {$_.Name -eq "All Computers"}
$allComputersGroup = $WSUSServer.GetComputerTargetGroups() | Where-Object {$_.Name -eq $allComputersGroupName}
#$currentAllComputersSubGroups = $WSUSServer.GetComputerTargetGroups() | Where-Object {($_.Name -ne "All Computers") -and ($_.GetParentTargetGroup() -eq $allComputersGroup)} | Select-Object -ExpandProperty Name
#$currentAllComputersSubGroups = $WSUSServer.GetComputerTargetGroups() | Where-Object {($_.Name -ne $allComputersGroupName) -and ($_.GetParentTargetGroup() -eq $allComputersGroup)} | Select-Object -ExpandProperty Name
foreach($subGroup in $subGroups){
if($subGroup -is [System.Xml.XmlElement]){#Computer group has sub groups
New-ComputerGroupFromXML -ParentComputerGroup $allComputersGroup -NewComputerGroupElement $subGroup
@@ -3036,6 +3036,21 @@
}
#endregion Parameter validation
+
+
+# Locale dependent "All Computers"
+If($Export -or $Import){
+
[string]$allComputersGroupName = $ImportOptions | Where-Object {$_.Name -eq "XMLConfiguration"} | Select-Object -ExpandProperty AllComputersGroupName -ErrorAction:Ignore
catch{ $allComputersGroupName = "All Computers" }
[string]$allComputersGroupName = $ExportOptions | Where-Object {$_.Name -eq "XMLConfiguration"} | Select-Object -ExpandProperty AllComputersGroupName -ErrorAction:Ignore
+}
#Try to load the UpdateServices module.
Try {`
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.