Jump to content

ThomL

Members
  • Posts

    388
  • Joined

  • Last visited

Everything posted by ThomL

  1. Are you using Power Automate to access the excel file and search the relevant column and then returning the filename of the relevant image file? Or are you looking at adding the excel file column content as metadata to the image files before uploading them to SharePoint? I would think Power Automate could pull this off, if not you could definitely make something with Power Apps that could do this. I'm guessing you not only want to search the current images via excel but also add images and a description? How far are you with Power Automate? is there any sticking point in particular you're looking for help with?
  2. Are you planning to wipe the csv daily or run comparisons on timestamps and user DNs? Using append on Export-CSV is going to stack all of the AD results repeatedly in the CSV file, adding a timstamp each time - which is fine if that's what you had planned or you're cleaning the csv file/comparing it with something etc. Another option is to compare the csv file to the results from AD, then append only the new items from AD to the csv file with the required timestamp: $csvFilePath = "C:\filename.csv" $ADou = "OU=Finance,OU=UserAccounts,DC=FABRIKAM,DC=COM" if(Test-Path $csvFilePath) { $CSVdata = Import-Csv $csvFilePath | select DistinguishedName -ExpandProperty DistinguishedName $ADdata = Get-ADUser -Filter * -SearchBase $ADou | select DistinguishedName -ExpandProperty DistinguishedName Compare-Object -ReferenceObject $CSVdata -DifferenceObject $ADdata | select InputObject -ExpandProperty InputObject | ForEach-Object { Get-ADUser -identity $_ | Select @{Name = "Data Pulled"; Expression = {Get-Date -Format o}}, * | Export-CSV C:\NAI\filename.csv -Append -NoTypeInformation } } else { Get-ADUser -Filter * -SearchBase $ADou | Select @{Name = "Data Pulled"; Expression = {Get-Date -Format o}}, * | Export-CSV $csvFilePath -Append -NoTypeInformation } Code execution outline: Code checks if the csv files exists, if csv file exists: Import the user DNs from csv Get user DNs from AD, Compared csv DNs to AD DNs, for each DN missing from CSV: Export user info to csv file, with timestamp If csv file didn't exist: Create csv file with info from AD
  3. 'Hardware SMS gateway' gets some results via google, e.g. https://www.smseagle.eu/ any good? Assuming you'd need to source something more geographically relevant of course...
  4. Fair enough, makes sense. If you go down the tinkering route I mentioned it be great to know how it turns out and if you get it working, or are you purely looking for an off-the-shelf solution?
  5. Another option (possibly), A 4g dongle with a sim to provide data services to a device. Device is also connected to the network so can receive the email via relay (or even do the monitoring itself?), uses the dongle as its gateway and makes contact via a cloud based SMS product, or sends an email/forwards the email? **EDIT** A quick search returned this if you were interested in some tinkering? https://www.selectiveintellect.net/blog/2021/8/19/setting-up-sms-sending-and-receiving-using-a-usb-gsm-dongle-by-zte
  6. This is the way I've done this before. Each pdf file had a unique filename, a csv contained the email address & filename combo, then PowerShell parsed the csv - creating and sending an email per line in the csv file, attaching the file in the filename column and sending to the email address in the email column. I also added some other columns so I could make the emails more personal, use individuals names in the email body etc. I'd share the code but I didn't keep it after I used it, sorry!
  7. Just tried this - still get the issue. Less consistent failure when first opening a PowerPoint and first clicking the Present button, but always getting the black screen and crashing tab if I esc a successful presentation full screen and click the present button a second time.
  8. We've got this issue too - raised it as an incident with Microsoft. Has anyone heard anything back from them yet?
  9. This seems doable - the following needs the beginning tweaked to load creds from file (that you save ahead of time [should be a one-time thing]). But it should work - setup an Office 365 group, make the people you want to receive the automated out of office message members, put the group name in the script and the message you want sent, then schedule to run each day from a server on-site: # Connect to Exchange Online $UserCredential = Get-Credential # Prompt for creds Connect-ExchangeOnline -Credential $UserCredential # Connect to Exchange online # Set variables $GroupName = "365TestGroup" # Office 365 Group Name $Members = Get-UnifiedGroupLinks -Identity $GroupName -LinkType Members # Get member of group $OOFStartTime = (Get-Date).Date.AddHours(17) # Set Start time to today at 17:00 PM hours $OOFFinishTime = (Get-Date).Date.AddDays(1).AddHours(5) # Set Finish time to tomorrow at 05:00 AM $OOFMessage = "This is a test - I think you could use HTML here...." # OOF Message to be sent # Loop through each member of the group and set OOF (if OOF not already set) foreach ($Member in $Members) { $OOFStatus = Get-MailboxAutoReplyConfiguration -Identity $Member.PrimarySmtpAddress # Get current OOF settings if ($OOFStatus.AutoReplyState -eq "Scheduled") { # OOF is already set... Write-Host "OOF is already set for $Member" -ForegroundColor Yellow # Alert OOF already set } else { # OOF is not set... Set-MailboxAutoReplyConfiguration -Identity $Member.PrimarySmtpAddress -AutoReplyState Scheduled -StartTime $OOFStartTime -EndTime $OOFFinishTime -ExternalMessage $OOFMessage -InternalMessage $OOFMessage # Set OOF Write-Host "OOF is set for $Member" -ForegroundColor Green # Alert OOF has been set } } # Disconnect from Exchange Online Disconnect-ExchangeOnline It skips people that already have an out of office set too. ***EDIT*** Found the code for creds, I haven't tested this part - but this looks how I remember handling credentials from file in PowerShell scripts previously. Save creds to file (should be able to run this just once to create the file): $credential = Get-Credential # Prompt for creds $credential | Export-CliXml -Path 'C:\My\Path\cred.xml' # Save creds to file Then change line 2 of the PowerShell Script from: [color=#222222]$UserCredential = Get-Credential # Prompt for creds[/color]To: $UserCredential = Import-CliXml -Path 'C:\My\Path\cred.xml' # Get creds from file
  10. I'm also in the Altaro + Wasabi boat - there are (were?) some things that still need work; like immutable backups, and the last time I looked at the GFS settings they were limited. Oh, and issues with disk usage on backup targets and the software not clearing the data from old backups... or something... this is fuzzy I don't really remember our issue but it seemed silly at the time and there's wasn't much that could be done, it's just the way the software was designed... this might not be an issue now... **EDIT** Looks like immutable backups/targets are coming in V9, which they are currently beta testing. https://www.hornetsecurity.com/en/services/vm-backup/vm-backup-v9-beta-download/
  11. Not much help. It did make a guess...
  12. ThomL

    Teams Down?

    365 status twitter might be worth a follow/bookmark for anyone that doesn't already follow/bookmark:
  13. This might be worth trying for the freeze function: https://github.com/askvictor/PauseToScreen
  14. Pull the network cable out the back so it doesn't try to connect and get stuck in the loop, update the IP, reconnect network cable, success? I'm not sure if this is a helpful suggestion....
  15. From a quick google there isn't a way to display the message the way you want - there will always be buttons I think it might be time to look at migrating this to a proper exe written in a different language. At the moment it's a hybrid of batch and vbs - I think you could make a hta (which is html + vbs) which may work. But I think it's probably a better approach to download Visual Studio community edition and then rebuild this tool in VB or similar. You already know what you want the tool to do and how you want it to look, it's just a case of googling how to achieve what the existing script is doing in VB piece by piece and build it up slowly, don't try to do everything at once. Making a Windows Forms based VB project in visual studio community you could then add controls like button and text etc. as required. You can enable/disable or display and hide these controls, or even make it look/act like a more traditional wizard. The please wait 'pop up' you can make a new form that has the text label control with the text "Please Wait" and then you show and hide the whole form as needed, disabling the original form that has all the options that the users chooses. I think migrating to a programming language rather than a scripting language will help and is the next step with your backup tool, doesn't have to be VB - I think VB might be one of the easier language to transition to from bat/vbs?
  16. Does this output the correct list of profiles? $profiles = $null $delDate = (Get-Date).AddDays(-14) $persistentProfilePaths = "C:\Users\Administrator","C:\Users\UpdatusUser" $profiles = Get-WMIObject -class Win32_UserProfile | Where {((!$_.Special) -and ($_.LastUseTime -lt $delDate))} foreach($profile in $profiles | where {$persistentProfilePaths -notcontains $_.LocalPath}) { write-host "$($profile.LastUseTime) $($profile.LocalPath)" #$profiles | Remove-WmiObject }
  17. I may have been wrong acting weird on my pc.... Quick edit, looks like it was my PC playing up! -lt is the correct operator
  18. The $_.lastusetime is looking for profile used in the last 2 weeks, is this what you're looking for? Or are you looking for profiles that haven't been used in the last 2 weeks?
  19. I haven't tested this, but there are some brackets missing on the $_.Lastusetime you combined into the Where. Does this work any better? $profiles = $null $profiles = Get-WMIObject -class Win32_UserProfile | Where {((!$_.Special) -and ($_.LocalPath -ne "C:\Users\Administrator") -and ($_.LocalPath -ne "C:\Users\UpdatusUser") -and ($_.LastUseTime -lt $(Get-Date).Date.AddDays(-14)))} if ($profiles -ne $null) { $profiles | Remove-WmiObject }
  20. Do you have the NPS role installed on the AD (guessing a DC?) server so it can handle the radius requests? When I've set this up before I've setup a dedicated NPS server to handle the radius stuff rather than bundle with a DC etc.
  21. Should work saved as a ps1, maybe open PowerShell ise from start menu, paste code in then save it and try it
  22. Seems I was right, thought you were about to sort it! Had this on my clipboard ready to post too (worked testing just the text line without html tags) : preg_split('/(ITEMP : )/', $input_line, $matches); $temp = $matches[1];
  23. Just a case of sorting the regex as you know. Having the 'ITEMP : ' string is most of the way there, can't be much more tweaking needed - if you can post the html line of the source webpage (via view source after page load) I can try to help with the regex further? Although I think you may have this sorted by the time I write this reply.
  24. Looks like this is what collects/presents/harvests/(...whatever) the data: (https://sourceforge.net/p/apcupsd/svn/HEAD/tree/trunk/examples/gui/status.tcl) [b]set[/b] fd [b][[/b]open "| ./client localhost:7000 status" "r"[b]][/b] [b]while[/b] [b]{[[/b]gets $fd line[b]][/b] > 0[b]}[/b] [b]{[/b] scan $line "%9s" label [b]switch[/b] -- $label [b]{[/b] BCHARGE [b]{[/b] scan $line "%*s : %f Percent" BattChg [b]}[/b] TIMELEFT [b]{[/b] scan $line "%*s : %f Minutes" TimeLeft [b]}[/b] LOADPCT [b]{[/b] scan $line "%*s : %f Percent" LoadPct [b]}[/b] HOSTNAME [b]{[/b] scan $line "%*s : %s" HostName [b]}[/b] RELEASE [b]{[/b] scan $line "%*s : %s" Release [b]}[/b] LINEV [b]{[/b] scan $line "%*s : %f Volts" LineV [b]}[/b] LOTRANS [b]{[/b] scan $line "%*s : %f Volts" LowTrans [b]}[/b] HITRANS [b]{[/b] scan $line "%*s : %f Volts" HiTrans [b]}[/b] RETPCT [b]{[/b] scan $line "%*s : %f Percent" RetPct [b]}[/b] ITEMP [b]{[/b] scan $line "%*s : %f C Internal" ITemp [b]}[/b] LINEFREQ [b]{[/b] scan $line "%*s : %f Hz" LineFreq [b]}[/b] BATTV [b]{[/b] scan $line "%*s : %f Volts" BattV [b]}[/b] NOMBATTV [b]{[/b] scan $line "%*s : %f" NomBattV [b]}[/b] MODEL [b]{[/b] scan $line "%*s : %s" Model [b]}[/b] STATUS [b]{[/b] scan $line "%*s : %s" Status [b]}[/b] I dunno... feels like this could be reverse engineered and used in a more direct way. Can you throw up the part of the source you are looking to scrape, think you might be able to use something like: preg_split('/(ITEMP :)/', $input_line);
×
×
  • Create New...