From what I can see in the AddInch function, you look to be trying to pass $regDocs but within that function your matching name against $regDocs where the parameter is $regex, and in calling AddInch, you have $regDoc where I believe it should be $regDocs.
It might be clearer if you edit your post and put all code into Code Sample blocks using the little icon on the bar with Bold, Itallic etc - 5th over with binary numbers as the image - Makes it a whole lot easier to read.
Should the AddLine function look like this:
Function AddInch($line, $regex) {
$line.PSObject.Properties | foreach-object {
$name = $.Name
$value = $.value
If ($name -match $regex){
$value1 = "mm " + ($value/25.4).tostring("0.000") + " inch"
} else { $value1 = ""}
"$name = $value $value1"
}
}
$regDocs="HEIGHT|RETRACT|THICKNESS|WIDTH|ZERO|grid_spacing"
AddInch($myjson.Document_values,$regDocs)
Hi, Thanks for your suggestions above.
I'm afraid I've only got access to the single device for testing at the moment as we don't buy in 'spare' devices so unfortunately I'm stuck with that device for now.
The DNS server is provided as part of a Fortigate firewall I'm not overly familiar with it enough to check the requests services by its DNS. It does allow for packet capture so I've been able to capture on the DMZ interface and can confirm that when accessing the resource via IP address, the traffic flow is captured in the packet capture but when trying to access via the FQDN there is no packet capture at all which suggests the request isn't leaving the device and being tunnelled.
I think like you suggest I might look to open up a support case for the issue and see where that takes me.
Hi,
The issue ended up being a missed firewall config in the perimeter in which only TCP 443 was open. On adding UDP 443 into the rule as well, DNS started to work as you would expect. I’ve been able to prove it’s working while the VPN is open and while configured for various split tunnel setups.
Hope this can help someone else in the future.
Hi, Thanks for that. I too would prefer not to hide them all with group policy so I think we might just need to accept this one for now as to me it would be too risky using that GPO setting.
The site already uses certificates from our own Enterprise CA so I know the cert side is good, website behaves exactly as you'd expect in IE11 but as they won't be around forever we needed something to bridge the gap - just seems Edge is going a better job at its risk assessment that IE11.
Many Thanks
Dave
Thanks, I'll see if its something the app support team are willing to do. As we don't have support for said app anymore I'd expect they wouldn't be keen to change anything on the source. I've taken a quick look and can confirm your correct that they do have references to support links under HTTP so I'd advise that's the reason and we can accept the risk of editing it or the risk of end users complaining.
Many Thanks
Dave
Hi Pradeep, Many thanks for your response. On some further investigate (clicking anything which sounding health or logging related) we found the Resource Health details and can see the VM was migrated due to an issue with the host so I'm fairly happy we now know where to look if this happens again.
Are you able to provide any details on any email warning we might be able to trigger on an event like this so we might be able to notify the system owner? The system in question related to SAP and there are some manual processed to safely bring the system back up after the VM is powered down so ideally I'd like to be able to notify the SAP team as soon as possible as in this instance the first they knew about any issue was calls to our IT Service Desk.
The VM in question was this one... Does that give you enough to take a quick look?
/subscriptions/0e7487e0-d510-4790-9161-e7c53b6a3d74/resourceGroups/BMBC_IAAS/providers/Microsoft.Compute/virtualMachines/AZ-SAPBWPRD
It isn't mentioned in the answer but one key thing to take away from this solution is that only running the Get-ADGroup once per group and accessing each property from the variable its saved in means this code will run a lot faster than your original example as your only making that search once. Where possible always try to take that approach as in testing smaller data sets it can seem insignificant but when running against your whole AD, there can be a huge time saving. Not always important if say running something overnight but might come in useful down the line so worth remembering.
I've been watching this one as I don't have a lot of regex experience so always keen to pickup tips.
This worked for me but only for servers with 2 digits at the end and in my case we sometime have servers which are 1 or 2 digits. I changed the regex to
^([a-z])(.+)([a-z])(\d+)$'
and it now looks to match any length string with any number of digits, as long as its 5 length or more.
I used this to test it
$Servers = @("onedigitserver1","twodigitserver02", "threedigitserver123","sma11")
$Servers | Foreach {
write-host "--------"
write-host $_
$_ -match '^([a-z])(.+)([a-z])(\d+)$'
$u = "{0}{1}{2}{3}" -f $matches[1].ToUpper(), $matches[2].ToLower(), $matches[3].ToUpper(), $matches[4]
$u
}
It won't work as is with Get-Content as that won't produce the right structure in the $Name variable. Using Import-csv is what created the .Filename structure of the $Name variable, without it the destination is being calculated as just C:\Check\ because the value of $Name.filename is blank - which is what you are seeing in your output. Can you run it again but keeping in the (Import-Csv -Path G:\temp\file.csv) to load the file. Make sure your CSV file is formatted as:
filename
1-1
1-2
If you wished to use a txt file with a list instead, it can be done but the code would need to be adjusted to suit it.

This shows what output I get with -WhatIf so you can see the pictures are all coming from the same source folder with the destinations being each of the corresponding folders based on the partial names loaded from the CSV file. As I've provided two code blocks, the output shows the same result from both.
Hi, are you removing the -RepetitionInterval? When using -Daily that is your repetition so you likely won’t have both. I’m not at my PC to verify it myself however if you take a look here (https://docs.microsoft.com/en-us/powershell/module/scheduledtasks/new-scheduledtasktrigger?view=windowsserver2022-ps) you can see the example syntax given and in the 2nd one down where -Daily is shown, you can see RepetitionInterval isn’t listed so isn’t a valid option.
I’m making the jump here that you have just changed -Once to -Daily, if this isn’t the case. Post up the error message you get as it will likely help direct to the issue