ThomL
Members-
Posts
388 -
Joined
-
Last visited
Content Type
Forums
News
20th
EduGeek EDIT Conference
Blogs
Everything posted by ThomL
-
What is the script not doing at the moment that you want it to do / what part requires some help?
-
-
In my current and previous school we use/used a very similar format to you: [Year of entry (YY)][First three letters of first name][First three letters of surname] With your duplication example we would have 23johsmi & 23johsmi2 Never had to update a username because of the other example you gave - even with some 'funny' usernames over the years there wasn't a problem. Not very useful i guess, but I thought I'd share - gives you 2 more schools as reference
- 35 replies
-
- active directory
- convention
-
(and 1 more)
Tagged with:
-
Strange VLAN to VLAN issue - unable to Ping some VMs
ThomL replied to timbo343's topic in Wired Networks
Turn logging on for every firewall rule on the smooth wall and watch the logs from the traffic - see if you can see another rule catching and stopping the traffic? -
Strange VLAN to VLAN issue - unable to Ping some VMs
ThomL replied to timbo343's topic in Wired Networks
Clients in a vlan have their gateway set to an IP attached to a Smoothwall interface to allow the Smoothwall to apply rules/route the traffic right? It would hint it's the firewall rules somehow. Have you tried rebooting the Smoothwall? I had an issue where port-forwarding and some firewall rules weren't working as expected - escalated to Smoothwall tier 2 support who advised I put everything back to how I had it configured, then reboot and test again ...and everything started working, the old off and on strikes again! -
Strange VLAN to VLAN issue - unable to Ping some VMs
ThomL replied to timbo343's topic in Wired Networks
If you run a traceroute to an uncontactable server and compare to a traceroute to a contactable server does this highlight where the traffic stops and point you in a direction to investigate? -
Strange VLAN to VLAN issue - unable to Ping some VMs
ThomL replied to timbo343's topic in Wired Networks
I'm sure you've checked this - network settings correct on the servers, correct gateway set? -
I've removed an email address from one AD user (email field and Proxyaddress), forced a delta sync to 365, then once sync has completed added the email address to another AD user's proxyAddress attrib. then forced another delta sync and not had any issues - new user has new alias email address. Although in this case I did remove the original user from being synced to Office 365 - not sure if that has an impact on this process. All in all - a max of 5 mins for this process I'd guess? Make a couple test accounts and give it a go! **Edit** I force syncs and watch them progress from the server that we have Azure AD Connect installed with this PowerShell: Write-Output "Office 365 Delta Sync Starting..." Start-Sleep -Seconds 2 Start-ADSyncSyncCycle -PolicyType Delta Write-Output "Sync Started - Opening Synchronization Service GUI" Start-Sleep -Seconds 2 Start-Process "C:\Program Files\Microsoft Azure AD Sync\UIShell\miisclient.exe"
- 5 replies
-
- active directory
- azure ad connect
- (and 3 more)
-
Smoothwall: Realtime webfilter questions
ThomL replied to browolf's topic in Internet Related/Filtering/Firewall
Hijacking the thread slightly - I've got a ticket open with smoothwall currently that's just been escalated from 1st to 2nd line - 1st line said the issue is certificate pinning from the ClassCharts iOS App, red items with a 200 in the real time: Escalation followed me asking how I could determine certificate pinning issues in the future to save opening support tickets - is it as simple as items being displayed in red while showing a 200 have a certificate issue? -
Thanks for posting about this, one of our RDS servers had a slowly filling hard drive after a little investigation it was the cache folders you mention. Tweaked the PowerShell Script slightly to handle the local user folders: $SystemFolderPath = "C:\Windows\System32\config\systemprofile\TOSHIBA\eSTUDIOX\UNIDRV\cache" $UserFoldersPath = "C:\users\" $ToshibaPath = "\TOSHIBA\eSTUDIOX\UNIDRV\Cache" $DaysToKeep = 5 if(Test-Path $SystemFolderPath){ ForEach($folder in Get-ChildItem –Path $SystemFolderPath | Where-Object {$_.LastWriteTime -lt (Get-Date).AddDays(-$DaysToKeep)}) { #Write-Host "Deleting:" $folder.Name "Modified :" $folder.LastWriteTime "Path:" $SystemFolderPath $folder | Remove-Item -Recurse -Force } } foreach($UserFolder in Get-ChildItem –Path $UserFoldersPath){ $ToshibaFolderPath = $UserFolder.FullName + $ToshibaPath if(Test-Path $ToshibaFolderPath){ ForEach($folder in Get-ChildItem –Path $ToshibaFolderPath | Where-Object {$_.LastWriteTime -lt (Get-Date).AddDays(-$DaysToKeep)}) { #Write-Host "Deleting:" $folder.Name "Modified :" $folder.LastWriteTime "Path:" $ToshibaFolderPath $folder | Remove-Item -Recurse -Force } } } Clear-RecycleBin -DriveLetter C -Force # Empty recycle bin on C drive.
-
End of msol cmdlets - setting up MgGraph for Powershell commands
ThomL replied to 3s-gtech's topic in Cloud Services
I don't know if this guide is any good, it's the one I've got bookmarked to read at some point: https://www.thelazyadministrator.com/2019/07/22/connect-and-navigate-the-microsoft-graph-api-with-powershell -
Does this work? (\W|^)teachersof|TeachersOf[\w.\-]{1,25}@[\w.\-]{1,25}\.theplt\.org\.uk(\W|$) I don't know enough regex... this matches on the tests I've done - I don't know how to make the teachersof|TeachersOf part case-insensitive.
-
Which one, mine? Maybe this: [color=#333333](\W|^)[teachersof][\w.\-]{1,25}@[\w.\-]{1,25}\.theplt\.org\.uk(\W|$)[/color]
-
How about this: (\W|^)teachersof[\w.\-]{1,25}@[\w.\-]{1,25}\.theplt\.org\.uk(\W|$) Tried to modify the "Match Any Email Address from a Specific Domain" example here: https://support.google.com/a/answer/1371417 Found these guidelines too: https://support.google.com/a/answer/1346938 ***EDIT*** Not sure why I thought you were doing this in Google Admin... It seems my brain just decided this was the case and went with it...
-
SAR Slack Request, Python Script
ThomL replied to DalekSec's topic in Data Protection & Information Handling
Not sure how performant it is, hopefully good enough? I did try to make the script multi-threaded, not something I've done much of before and this seems to work for me, for each JSON file found it should launch a new job to search the file (I think): # Prompt the user for the search term $searchTerm = Read-Host "Enter the search term" # Specify the root folder to start the search $rootFolder = "C:\Users\Thom\Downloads\" # Get json files $jsonFiles = Get-ChildItem -Path $rootFolder -Filter *.json -Recurse # Function to search JSON filenames and content for the search term $functions = { function SearchJsonFiles($json, $searchTerm) { $filenameContainsTerm = $json.Name -like "*$searchTerm*" $contentContainsTerm = Get-Content $json.FullName | Select-String -Pattern $searchTerm if ($filenameContainsTerm -or $contentContainsTerm) { Write-Output "Match found in $($json.FullName)" } } } # Create jobs for parallel processing $jobs = @() # Foreach Json file found spawn a new job to search the file foreach ($json in $jsonFiles) { $job = Start-Job -InitializationScript $functions -ScriptBlock {SearchJsonFiles $using:json $using:searchTerm} $jobs += $job } # Wait for all jobs to complete $jobs | Wait-Job | Out-Null# Retrieve job results and remove the jobs $jobs | ForEach-Object { Receive-Job $_ Remove-Job $_ } I did try another version that starts a job per directory found, but this seems far slower... maybe there's something wrong in the code. It did complete with the expected result eventually: # Prompt the user for the search term $searchTerm = Read-Host "Enter the search term" # Specify the root folder to start the search $rootFolder = "C:\Users\Thom\Downloads\" # Function to search JSON filenames and content for the search term $functions = { function SearchJsonFiles($Folder, $searchTerm) { $jsonFiles = Get-ChildItem -Path $Folder.FullName -Filter *.json foreach ($json in $jsonFiles) { $filenameContainsTerm = $json.Name -like "*$searchTerm*" $contentContainsTerm = Get-Content $json.FullName | Select-String -Pattern $searchTerm if ($filenameContainsTerm -or $contentContainsTerm) { Write-Output "Match found in $($json.FullName)" } } } } # Create jobs for parallel processing $jobs = @() # Get root folder as directory object $rootDir = Get-Item $rootFolder # Get all subfolders $folders = Get-ChildItem -Path $rootFolder -Directory -Recurse # spawn job for root folder $jobs += Start-Job -InitializationScript $functions -ScriptBlock {SearchJsonFiles $using:rootDir $using:searchTerm} # Foreach subfolder spawn a new job searching for json files and searching the files foreach ($folder in $folders) { $job = Start-Job -InitializationScript $functions -ScriptBlock {SearchJsonFiles $using:folder $using:searchTerm} $jobs += $job } # Wait for all jobs to complete $jobs | Wait-Job | Out-Null # Retrieve job results and remove the jobs $jobs | ForEach-Object { Receive-Job $_ Remove-Job $_ } I've been messing about with this far too long and give up! -
SAR Slack Request, Python Script
ThomL replied to DalekSec's topic in Data Protection & Information Handling
This worked for me with some example and test JSON files downloaded from random sites, original non multi-threaded PowerShell had a bad parameter on the out-string cmdlet, so I removed it and things look good: # Prompt the user for the search term $searchTerm = Read-Host "Enter the search term" # Specify the root folder to start the search $rootFolder = "C:\path\here\" # Function to search for JSON files and check for the search term function SearchJsonFiles($path) { $jsonFiles = Get-ChildItem -Path $path -Filter *.json -Recurse foreach ($jsonFile in $jsonFiles) { $filenameContainsTerm = $jsonFile.Name -like "*$searchTerm*" $contentContainsTerm = Get-Content $jsonFile.FullName | Select-String -Pattern $searchTerm if ($filenameContainsTerm -or $contentContainsTerm) { Write-Host "Match found in $($jsonFile.FullName)" } } } # Start the search SearchJsonFiles $rootFolder -
SAR Slack Request, Python Script
ThomL replied to DalekSec's topic in Data Protection & Information Handling
Well that sucks - hard to help further without files to test with, which can't be shared because of the nature of the files! Maybe it's an issue with the way the scripts are trying to find the data in the JSON, or maybe the way they are accessing the JSON... I dunno! I'll try to find some demo JSON files from the web to play with... -
SAR Slack Request, Python Script
ThomL replied to DalekSec's topic in Data Protection & Information Handling
Well that's annoying! Guessing you've also updated the parts of the scripts as needed? e.g. in the PowerShell there is a line that need you put the root folder path: [color=#333333]# Specify the root folder to start the search [/color][color=#333333]$rootFolder = "C:\Path\To\Root\Folder"[/color] -
SAR Slack Request, Python Script
ThomL replied to DalekSec's topic in Data Protection & Information Handling
You tried the scripts I posted and still got the same 0 results? -
SAR Slack Request, Python Script
ThomL replied to DalekSec's topic in Data Protection & Information Handling
I'm no good with python, asked chatgpt to make a powershell script and this looks pretty good, might be worth a go? # Prompt the user for the search term $searchTerm = Read-Host "Enter the search term" # Specify the root folder to start the search $rootFolder = "C:\Path\To\Root\Folder" # Function to search for JSON files and check for the search term function SearchJsonFiles($path) { $jsonFiles = Get-ChildItem -Path $path -Filter *.json -Recurse foreach ($jsonFile in $jsonFiles) { $filenameContainsTerm = $jsonFile.Name -like "*$searchTerm*" $contentContainsTerm = Get-Content $jsonFile.FullName | Out-String -Raw | Select-String -Pattern $searchTerm if ($filenameContainsTerm -or $contentContainsTerm) { Write-Host "Match found in $($jsonFile.FullName)" } } } # Start the search SearchJsonFiles $rootFolder This is apparently a multi-thread version of the PowerShell above: # Prompt the user for the search term $searchTerm = Read-Host "Enter the search term" # Specify the root folder to start the search $rootFolder = "C:\Path\To\Root\Folder" # Function to search for JSON files and check for the search term function SearchJsonFiles($path) { $jsonFiles = Get-ChildItem -Path $path -Filter *.json -Recurse foreach ($jsonFile in $jsonFiles) { $filenameContainsTerm = $jsonFile.Name -like "*$searchTerm*" $contentContainsTerm = Get-Content $jsonFile.FullName | Out-String -Raw | Select-String -Pattern $searchTerm if ($filenameContainsTerm -or $contentContainsTerm) { Write-Host "Match found in $($jsonFile.FullName)" } } } # Create jobs for parallel processing $jobs = @() $folders = Get-ChildItem -Path $rootFolder -Directory foreach ($folder in $folders) { $job = Start-Job -ScriptBlock { param($folderPath) SearchJsonFiles $folderPath } -ArgumentList $folder.FullName $jobs += $job } # Wait for all jobs to complete $jobs | Wait-Job # Retrieve job results and remove the jobs $jobs | ForEach-Object { Receive-Job $_ | ForEach-Object { Write-Host $_ } Remove-Job $_ } I also asked ChatGPT to convert the PowerShell to Python and multi-thread it, this is the result: import os import json import concurrent.futures # Prompt the user for the search term search_term = input("Enter the search term: ") # Specify the root folder to start the search root_folder = "C:\\Path\\To\\Root\\Folder" # Function to search for JSON files and check for the search term def search_json_files(path): for foldername, subfolders, filenames in os.walk(path): for filename in filenames: if filename.endswith(".json"): file_path = os.path.join(foldername, filename) with open(file_path, "r", encoding="utf-8") as json_file: try: json_data = json.load(json_file) if search_term in filename or search_term in json.dumps(json_data): print(f"Match found in {file_path}") except json.JSONDecodeError: pass # Create a thread pool for parallel processing with concurrent.futures.ThreadPoolExecutor() as executor: folders = [os.path.join(root_folder, folder) for folder in os.listdir(root_folder) if os.path.isdir(os.path.join(root_folder, folder))] results = list(executor.map(search_json_files, folders)) # Note: In this example, we're using ThreadPoolExecutor. You can also use ProcessPoolExecutor for parallel processing using separate processes. -
I think these were used at a previous job: https://www.thebarcodewarehouse.co.uk/shop/rf-ideas/smart-card-reader/RDR-7585AKU A quick google is bringing these up at £25 - might be worth getting one in to test at that cost: https://www.idcardsdirect.co.uk/contactless-rfid-keyboard-wedge-reader.html
-
From my testing, issue appears to be whitespace in the $ProcessorModel variable - updating to trim the whitespace got the if working. Updated code, last line removes the whitespace: # Gather the data from the local system $processor = Get-WmiObject -Class Win32_Processor $ProcesorName2 = $processor.Name $ProcessorModel,$Speed = $ProcesorName2 -Split "CPU" $ProcessorModel = $ProcessorModel.TrimEnd(" ") You can also tidy the $Speed variable to remove the "@" and whitespace: # Gather the data from the local system $processor = Get-WmiObject -Class Win32_Processor $ProcesorName2 = $processor.Name $ProcessorModel,$Speed = $ProcesorName2 -Split "CPU" $ProcessorModel = $ProcessorModel.TrimEnd(" ") $Speed = $Speed -replace "@","" $Speed = $Speed.Trim() There's probably a more elegant way to do things, but this was quick and got it working.
-
Power Automate could be the right solution, just depends on the work needed to pull off what you want with SharePoint to allow the searching and modification etc. From the requirements you've mentioned and my recent experience with PowerApps I think it's achievable with PowerApps, but might take longer to get up and running, and I could easily be wrong. I'd recommend starting small like anything. Get a PowerApp connected to a SharePoint list and able to add images to the list from the app, then move on to trigger trigger the thumbnail generation flow when a new item is added to the SharePoint list. then add an area to enter descriptive text in the app and a column in the SharePoint list to store the text, move on to editing existing items, search etc. etc. Feel free to drop me a DM if I can help, or bump the thread - I'm intrigued!
-
It might be worth pivoting to PowerApps, store the data like image filename, descriptive items, thumbnail and original in the SharePoint list then use the PowerApp to manage user interactions with the data like adding images and decryptions, searching the existing list or modifying existing records. I recently made a staff leave request system using PowerApps as the front end - users access the PowerApp to submit requested/track request progress, managers approve/deny leave in the power app and HR have an over view of all leave requests and are the final approve/deny step. The data is written back to a SharePoint list, I use PowerAutomate to trigger flows when the SharePoint list has new items created or items in the list are updated to alert users via email: managers alerted they have a request to approve, persons submitting the leave request of any changes to the request (if approved or denied, stage of the approval process etc.) and HR alerted for final approval. Another daily flow triggers just before the HR staff member is on site during the week that sends a report from the list to display leave for the data and timetable periods that need covering. SharePoint + PowerApps+ PowerAutomate is a pretty strong combo. It took some work to get this built, tested and dealing with edge cases, but everyone seems happy with the outcome. Depending on how much you want to get your hands dirty and bespoke you want the solution, PowerApps has some quirks but you could integrate the flow you've already made into a PowerApps app so you've got the thumbnail creation already in place. That being said I'm sure you could do this without PowerApps, but if you learning new stuff it plays nicely with what you're already picking up. Not sure I've been too helpful if I'm honest. I did start looking at a native SharePoint solution after my first reply using asset Libraries but getting the tags metadata searchable was proving to be a pain - if it had been easy a SharePoint asset library may have been the easiest solution.
