The script below creates a xml for each printer on a print server. Just replace the flex path and printer server place holders.
Refresh DEM and edit the assignment conditions and you’re done.
$PrintServer = '<unc path print server>'
$FlexPath = '\\<unc path dem config server>\general\FlexRepository\Printer\'
$Printers = Get-Printer -ComputerName $PrintServer | Where Name -ne 'Microsoft XPS Document Writer'
foreach($Printer in $Printers){
[System.XML.XMLDocument]$XML = New-Object System.XML.XMLDocument
[System.Xml.XmlWriterSettings] $XmlSettings = New-Object System.Xml.XmlWriterSettings
[System.Xml.XmlWriter] $XmlWriter = [System.Xml.XmlWriter]::Create($XmlFile, $XmlSettings)
[System.XML.XMLElement]$Root = $XML.CreateElement("userEnvironmentSettings")
$XmlFile = $FlexPath + $Printer.Name + ".xml"
$XmlSettings.Encoding = New-Object System.Text.UTF8Encoding($false)
$XML.appendChild($Root)
[System.XML.XMLElement]$Node1 = $Root.AppendChild($XML.CreateElement("setting"))
$Node1.SetAttribute("type","Printer Mapping")
$Node1.SetAttribute("async","1")
$Node1.SetAttribute("remote","\\" + $PrintServer + "\" + $Printer.ShareName)
$Node1.SetAttribute("default","1")
$Node1.SetAttribute("label",$Printer.Name)
$Node1.SetAttribute("undo","1")
[System.XML.XMLElement]$Node2 = $Root.AppendChild($XML.CreateElement("conditions"))
$XML.Save($XmlWriter)
}