fordea
Members-
Posts
70 -
Joined
-
Last visited
Content Type
Forums
News
20th
EduGeek EDIT Conference
Blogs
Everything posted by fordea
-
There's a nice article here about how to convert HTML tables to Objects using Powershell which will make the checks you need simpler and more adaptable: https://sysjam.wordpress.com/2016/01/08/consuming-html-tables-with-powershell/ You'll need to modify the function to parse HTML from a file instead of a webpage though. Something such as changing these lines should do the trick: Param( [uri]$URL = 'https://support.microsoft.com/en-us/lifecycle/search?sort=PN&alpha=windows%2010&Filter=FilterNO', [boolean]$firstRowHeader = $false ) #Get the webpage $page = Invoke-WebRequest $URL #Filter out only the tables $tables = $page.ParsedHtml.body.getElementsByTagName('Table') to Param( [string]$File, [boolean]$firstRowHeader = $false ) $html = New-Object -ComObject "HTMLFile" $html.IHTMLDocument2_write($(Get-Content -Path $File -Raw)) $tables = $html.all.tags("table") Then you should be able to call the function with your sample file and then filter the results with any checks you like: $results = Get-HTMLTables -File D:\test\Status.html -FirstRowHeader $true $results.0 | Where-Object {$_.Server -match 'Server1' -and $_.Status -eq 'Offline'}
-
I had the same issue with lots of section groups provisioned by SDS that weren't provisioning in to teams. We have around 500 of these groups and none of them were provisioning automatically like they had done in the past. We soon realised that they started provisioning about 5-10 minutes after the group owner logged in to Teams so figured that Microsoft had implemented some throttling based on that. Unfortunately this didn't work for all of them though and in the end I had to use powershell to create the remaining 200 or so teams that just wouldn't provision even after the owner had logged in to Teams multiple times.
-
I actually came across this recently myself. The latest version that included the Template parameter is 0.9.6 (They removed it in the 1.0 release). You can install it via: Install-Module -Name MicrosoftTeams -RequiredVersion 0.9.6 and then import that version via: Import-Module MicrosoftTeams -RequiredVersion 0.9.6 However in that version of the module the New-Team cmdlet doesn't have the MailNickname parameter as in your example, it's instead called Alias
-
Have you given this a try yet: https://social.technet.microsoft.com/Forums/en-US/7c108313-5b09-420a-b18a-0f0fbc23255b/make-organizational-unit-a-required-field-in-lite-touch-wizard?forum=mdt I'd suggest making a copy of the DeployWiz_ComputerName.xml file before adding the tag so you can restore the original if it doesn't work
-
I'd suggest using Get-CimInstance instead of Get-WmiObject as you'll get the dates back as DateTime objects already so won't need to do any conversion. If you need to use Get-WmiObject then you can use the ManagementDateTimeConverter class: [system.Management.ManagementDateTimeconverter]::ToDateTime($_.TimeGenerated)
-
Does your Impero power-on schedule attempt to power on your computers throughout the whole school day or just once in the morning?
-
Bit of a shot in the dark but have you setup any scheduled Wake on LAN software recently?
-
It's to do with the way Powershell outputs a DateTime object (for instance if you do a Get-Date in the console notice how there is a blank line before the date is printed and then two blank lines after it. This should mimic the output you're getting in the file). If you create a string representation of the date beforehand it should work: [datetime]::FromFileTime($_).ToString()
-
Ok so I think I get what you're after. There's a couple of amendments I'd suggest to make based on your requirements. It's probably easier if I just post the full code instead of the changed bits as there's quite a few: $patchesToSearch = [ordered]@{ 'group1' = 'KB453300', 'KB453071', 'KB451956' 'security patch 01' = 'KB4465065' 'KB4480979' = 'KB4480979' 'whatever name you like' = 'KB1234567' } $timeoutSeconds = 10 $computerList = Get-ADComputer -Filter "OperatingSystem -like '*Windows 10*'" $results = foreach ($computer in $computerList) { $connex = Test-Connection $computer.Name -Count 1 -TTL 100 -Quiet if ($connex) { $code = { Get-HotFix -computername $using:computer.Name | Select HotFixId, InstalledOn | Sort InstalledOn -Desc } $j = Start-Job -ScriptBlock $code if (Wait-Job $j -Timeout $timeoutSeconds) { $hotFixInfo = Receive-Job $j } Remove-Job -force $j $patchesNeeded = $patchesToSearch.Values | Foreach-Object { if ($_ -is [array]) { if ($null -eq (Compare-Object $_ $hotFixInfo.HotFixID -IncludeEqual -ExcludeDifferent)) { $_[-1] } } elseif ($hotFixInfo.HotFixID -notcontains $_) { $_ } } switch ($patchesNeeded.count) { 0 {$patchesNeededStr = 'Fully patched'} {$_ -gt 0} {$patchesNeededStr = $patchesNeeded -join ', '} } } else { $patchesNeededStr = 'Offline' } [PSCustomObject]@{ Name = $Computer.Name PatchesNeeded = $patchesNeededStr } } $results | Export-Csv D:\test\name.csv -NoTypeInformation The main difference is switching from using an array to a hashtable for listing the patches you want to search for, this makes it easier to create 'groups' of patches to search for as 2D arrays can be a pain in Powershell. The keys of the hashtable don't matter so use whatever names for the keys that you like. If you create a group of patches (like 'group1' = 'KB453300', 'KB453071', 'KB451956' in my example) and the computer doesn't have any of those patches then it will only output the last one (KB451956) to the CSV for that group as it assumes that it is the most recent one. Also it should now output any computers that are fully patched or offline to the CSV too.
-
So if the PC is off or already fully patched you also want those output to the same CSV? Also with regards for checking for updates that have been replaced how do you want to handle these cases: None of the group of patches are installed: I'm guessing you want to output the latest one to the CSV instead of all of them? One of the patches in a group is installed but not the latest one: Do you want the latest one output to the CSV or no output for that group of patches?
-
if you change the following: [color=#333333][PSCustomObject]@{[/color] [color=#333333] Name = $Computer.Name[/color] [color=#333333] PatchesNeeded = $patchesNeeded[/color] [color=#333333]}[/color] to [color=#333333][PSCustomObject]@{[/color] [color=#333333] Name = $Computer.Name[/color] [color=#333333] PatchesNeeded = $patchesNeeded -join ', '[/color] [color=#333333]}[/color] it should output the patches needed as strings to the csv.
-
You can add an array to the top of your code containing a list of the patches to want to search for: $patchesToSearch = @( 'KB4519565' 'KB4486156' ) And then change this bit: foreach ($hotfix in $hotFixInfo) { [PSCustomObject]@{ Computername = $computer.Name HotfixID = $hotfix.HotFixID PatchDate = $hotfix.InstalledOn.ToString('dd/MM/yyyy') OperatingSystem = $computer.OperatingSystem } } to: $patchesNeeded = $patchesToSearch.Where{$hotFixInfo.HotFixID -notcontains $_} if ($patchesNeeded.count -gt 0) { [PSCustomObject]@{ Name = $Computer.Name PatchesNeeded = $patchesNeeded } } else { Write-Verbose "Computer $($computer.Name) is already patched" }
-
[ms office - o365] Office 365 - Device Based Activation
fordea replied to robbie-w's topic in Office Software
Can confirm that this is still only for EES customers as our reseller told us this today -
Hmm so using your example something like this will give you all the hotfixes installed on your computers: $timeoutSeconds = 10 $computerList = Get-ADComputer -Filter "OperatingSystem -like '*Windows 10*'" $results = foreach ($computer in $computerList) { $connex = Test-Connection $computer.Name -Count 1 -TTL 100 -Quiet if ($connex) { $code = { Get-HotFix -computername $using:computer.Name | Select HotFixId, InstalledOn | Sort InstalledOn -Desc } $j = Start-Job -ScriptBlock $code if (Wait-Job $j -Timeout $timeoutSeconds) { $hotFixInfo = Receive-Job $j } Remove-Job -force $j foreach ($hotfix in $hotFixInfo) { [PSCustomObject]@{ Computername = $computer.Name HotfixID = $hotfix.HotFixID PatchDate = $hotfix.InstalledOn.ToString('dd/MM/yyyy') OperatingSystem = $computer.OperatingSystem } } } else { Write-Warning "Computer $($computer.name) can't be contacted" #computer can't be contacted } } $results | Export-Csv D:\test\patches.csv -NoTypeInformation You could even just filter it so that you only export the names of the computers that are missing all four hotfixes to a file to save you having to manually filter the results in Excel
-
Is it just the latest installed hotfix for each computer that you want to export or all hotfixes for each computer?
-
We use PDQ Deploy here too. PDQ really relies on your environment having a healthy / up to date DNS. From your description I'm guessing that your laptops may often get different IP addresses and thus multiple entries in DNS until the old records are scavenged. There's an option in PDQ Deploy under Preferences -> Performance called 'Test Multiple Addresses in Name Resolution' that will attempt to ping all addresses for a particular computer name in DNS before deploying. It's worth enabling that and trying to deploy to a laptop again to see if that helps
-
We did our upgrade over the summer and it went smoothly. The only hiccup we had was after we'd updated to v6 that some of our doors were exhibiting behaviours such as not accepting valid tokens and not adhering to the timezone unlock policies. This was sorted by reinstating those doors in Paxton Net2. I believe reinstating the doors causes the server to push the database information down to the door's ACU so it's worth giving that a try if any of your doors misbehave after the upgrade.
-
There's a nice function here that checks if an IP address is within a subnet using CIDR notation: https://github.com/omniomi/PSMailTools/blob/v0.2.0/src/Private/spf/IPInRange.ps1. So if you plugged that function into the example by @stevec_ you would need to alter the $IP_Ranges hash table to contain subnets using CIDR notation: $IP_Ranges = @{ "10.30.1.0/24"="PAL-"; "10.10.10.0/24"="BAL-" } And then you'd just need change the check in the loop of the hash table to: if (IPInRange $My_IP $_) { ... }
-
I can only see the share permissions from your screenshot but if as you say the folder permissions are empty then that's probably whats causing the issue. Make sure your service account specified in the bootstrap.ini has at minimum NTFS read permissions on the DeploymentShare folder
-
Have you double checked the NTFS/Share permissions on the DeploymentShare folder? Perhaps the update has changed these for some reason. I believe the service account that you've specified in the bootstrap.ini file needs at least read permissions on the folder
-
Do the affected computers have a _SMSTaskSequence folder in the C: drive? Sometimes this folder gets left behind if a previous task sequence doesn't complete fully. I think that there could be some files in there that may be causing the issue. One of the previous comments suggested using diskpart to clean the disk which could work. You can get a CMD window up to use diskpart if you press F8 just as the machine is booting into the MDT image.
-
I noticed in your screenshots with the errors that the deployment share server name is different each time. One is \\WSUS\DeploymentShare$ and the other is \\WHIRLPOOL\DeploymentShare$. Do you have two different WDS servers or are these just two A records for the same server? Also, are you using the administrator approval option in WDS and if so are the devices you are testing it with listed under 'Active Directory Prestaged Devices'? I've had instances in the past where I've had to remove them from this list and re-do the administrator approval for them.
-
Have you checked that they are not being set under Group Policy User Preferences - Control Panel Settings - Internet Settings - Internet Explorer 10? If not you could try to create a new policy containing Internet Explorer 10 settings and specify it to apply a blank proxy field. Any settings that have a green line under them should be applied (you can press F6 on a setting to change the red line to green and F7 to turn them from green to red).
-
You should get what you're after by changing the -contains operator to -match in your if statement
- 6 replies
-
- 1
-
-
- office activation
- powershell
-
(and 1 more)
Tagged with:
-
Number 3) is caused by Windows attempting to create a Microsoft Edge shortcut on the user's desktop on first login (I believe this behaviour was introduced in 1803). You can prevent it from doing this via setting the following registry key in a script/group policy: [color=#373737]Key: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer[/color] [color=#373737]Value: DisableEdgeDesktopShortcutCreation[/color] [color=#373737]Data: 1[/color] [color=#373737]Type: REG_DWORD[/color] If you're using MDT or SCCM to build your image then the easiest way is to create a 'Run Command Line' step in your task sequence and provide the following command: [color=#373737][font=&]reg.exe add HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer /v DisableEdgeDesktopShortcutCreation /t REG_DWORD /d 1[/font][/color]
