powershell

How to create an alert for expiring AD Users

纵然是瞬间 提交于 2021-02-05 09:41:38
问题 this is my first try in Powershell and I have to say I have no Idea what I am doing. So I want to create a Script, that when it runs send an E-Mail to an Admin with a list of ADUsers who are going to expire within the next 30 Days. This was my first try to get the Users as an output but it doesn't work and I have no Idea why not. So I can't go on and do the Mail-Send thing. I didn't find anything similar on the internet too. Get-ADUser -Filter 'enabled -eq $true' -SearchBase "CN=Users, DC

Powershell - How can I deal with this type of drop down in I

核能气质少年 提交于 2021-02-05 09:30:30
问题 Screenshot How can I automate powershell to select the Company fro this type of dropdown because it's not a normal drop down but it shows values only once you start typing? For e.g. in this case when I type C it shows Company. Refer the screenshot image above. Following code inserts the value but it doesn't recognize it and gives an error asking to input value - $test.document.getElementById("val1").value = "Company (Company)" Below code which works for normal drop-downs doesn't work here -

Trying to wrap my head around PowerShell - functions, aliases etc

放肆的年华 提交于 2021-02-05 09:16:25
问题 I'm a seasoned C# programmer, but so far, I have only barely dabbled in PowerShell (having used another alternate Windows command line product so far). I'm trying to automate some Git stuff, and I've run into some difficulties and can't seem to find any solution to these... (and no video tutorial or blog post seems to have helped much so far, either). What I'm trying to do is define functions and aliases that make my work with Git in PowerShell more comfortable - and yes, I know about Posh

Out-FINcodedCommand.ps1 is not recognized - executing a script in the current directory

戏子无情 提交于 2021-02-05 09:11:06
问题 I have seen this script https://github.com/danielbohannon/Out-FINcodedCommand/blob/master/README.md And when I try the the example given I get the error Out-FINcodedCommand.ps1 : The term 'Out-FINcodedCommand.ps1' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 Out-FINcodedCommand.ps1 -command "iex (iwr https://github.com/danielb ...

Out-FINcodedCommand.ps1 is not recognized - executing a script in the current directory

匆匆过客 提交于 2021-02-05 09:05:28
问题 I have seen this script https://github.com/danielbohannon/Out-FINcodedCommand/blob/master/README.md And when I try the the example given I get the error Out-FINcodedCommand.ps1 : The term 'Out-FINcodedCommand.ps1' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 Out-FINcodedCommand.ps1 -command "iex (iwr https://github.com/danielb ...

Out-FINcodedCommand.ps1 is not recognized - executing a script in the current directory

自古美人都是妖i 提交于 2021-02-05 09:05:00
问题 I have seen this script https://github.com/danielbohannon/Out-FINcodedCommand/blob/master/README.md And when I try the the example given I get the error Out-FINcodedCommand.ps1 : The term 'Out-FINcodedCommand.ps1' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 Out-FINcodedCommand.ps1 -command "iex (iwr https://github.com/danielb ...

Powershell, look through all drives

坚强是说给别人听的谎言 提交于 2021-02-05 09:03:53
问题 I'm new to Powershell and I've tried finding a solution to my problem online but I can't seem to find one. Basically I need to write something that will let powershell look through all drives and directories to find the following: total number of files (exclude folders), largest file size, average file size, total file size Here's what I've written so far: $source = "get-psdrive" #attempt at looking through all drives/directories which didn't work foreach($a in $source) { #counts files in

Return a reference to an Excel Worksheet from a PowerShell Function

天大地大妈咪最大 提交于 2021-02-05 09:01:52
问题 For the sake of code readability, I'd like to move my Excel stuff to a function and leave the worksheet object available to write cell values as my program processes stuff. How do I call a function that creates an Excel spreadsheet and return a worksheet reference so I can continue to access the open/active Excel app object I've created? Function Create-Excel-Spreadsheet() { # open excel $excel = New-Object -ComObject excel.application $excel.visible = $True # add a worksheet $workbook =

Return a reference to an Excel Worksheet from a PowerShell Function

倾然丶 夕夏残阳落幕 提交于 2021-02-05 09:01:18
问题 For the sake of code readability, I'd like to move my Excel stuff to a function and leave the worksheet object available to write cell values as my program processes stuff. How do I call a function that creates an Excel spreadsheet and return a worksheet reference so I can continue to access the open/active Excel app object I've created? Function Create-Excel-Spreadsheet() { # open excel $excel = New-Object -ComObject excel.application $excel.visible = $True # add a worksheet $workbook =

powershell core error: The specified module 'RPC-Client' was not loaded

生来就可爱ヽ(ⅴ<●) 提交于 2021-02-05 08:53:09
问题 How do I find out more information about xml-rpc for powershell ? PS /home/nicholas> PS /home/nicholas> Update-Help PS /home/nicholas> PS /home/nicholas> Get-Help Send-XmlRpcRequest Get-Help: Get-Help could not find Send-XmlRpcRequest in a help file in this session. To download updated help topics type: "Update-Help". To get help online, search for the help topic in the TechNet library at https://go.microsoft.com/fwlink/?LinkID=107116. PS /home/nicholas> PS /home/nicholas> Get-Host | Select