New answers tagged

3

No, not as you asked the question. This info is not in Active Directory, sorry to say. You could however write some PowerShell, starting with Get-ADComputer likely with a filter to just get server operating systems, and then pipe or loop that into either WMI or Registry queries to get the list of installed software - and hopefully the version info you want ...


3

Maybe your crontab file now looks like: # My cronjobs: * 2 * * * /scripts/task1.sh * 4 * * * /scripts/task2.sh You have multiple options instead of hoping that scheduling two cron jobs far enough apart is sufficient that they won't overlap when one runs a bit longer than expected: 1. Simply schedule a single cron job that executes multiple scripts ...


0

First thing I see is when i run 'Get-ADComputer' it wants a filter. After the filter is applied i still dont see "accountdisabled" property for Get-AdComputer, I think you mean "Enabled" $computers = Get-ADComputer -Filter * | where {$_.Enabled -eq $false} You might want to change that filter before running. Edit: sorry; to find the properties run Get-...


1

sudo iptables -t nat -D <whatever you did had after -I> (D stands for delete)


0

When I complete automation projects or do automation training classes I'm always asked why I don't use Export-Csv. Microsoft claims Export-Csv is the same as ConvertTo-Csv except that it saves the output to the file. While that statement is literally correct, it's not a replacement for the tried and true code of: $Objects | ConvertTo-Csv -...


1

When using network resource file systems, and UNC paths, you should use the filesystem:: PSProvider in Powershell. Here's a couple examples: Test-Path "filesystem::\\127.0.0.1\c$" Test-Path "filesystem::\\$env:computername\c$" Adapting this process to your code should be as simple as: foreach ($server in $servers){ net use $server /USER:domain\...


0

create file lists.txt for all users that you need to create folder copy and save as FolderMaker.cmd SET _dest=P:\PersonalFolders SET _script=C:\Scripts path=C:\Windows\System32\ for /f "tokens=*" %%a in (%_script%\list.txt) do md %_dest%\%%a run with admin right


2

It looks like you're trying to combine properties from multiple objects onto the output stream. I think the best way to accomplish your goal is to leverage calculated properties on your pipeline. However, in your code example MBXProps is an undeclared variable which may be the leading cause to why your process isn't working. Though you've likely cherry ...


0

try this: user@host:~$ read -d '' x <<EOF > mic > check > one > two > EOF no line breaks: user@host:~$ echo $x mic check one two yes line breaks: user@host:~$ echo "$x" mic check one two


1

cowsay $ cowsay cowsay makes banners ______________________ < cowsay makes banners > ---------------------- \ ^__^ \ (oo)\_______ (__)\ )\/\ ||----w | || || $ cowsay -f tux cowsay is customisable ________________________ < cowsay is customisable > ---------------------...


1

It depends on what the issue is. If you are not running under a user context at all, like under the SYSTEM account, then you might need to run as a particular user, which typically means specifying a username and password, which is often problematic. If the issue is that you currently have admin rights, but need to run something without those admin rights, ...


1

In my own scripts I use psexec in those situations. You have to specify username and password for a different account as well as an executable which then runs as the specified user. This is not pure PowerShell but good enough for me. It may be possible for a PowerShell script to do the same thing psexec does. But unless you find out, this should solve your ...


1

To encrypt your script and ensure no one gets to view it, you have two options: First Option Use the openssl command to manually encrypt it. And in the future, when you want to run the script, you'll have to run openssl manually again, and provide the password to decrypt. Encryption with openssl: cat yourscript.sh | openssl aes-128-cbc -a -salt -k ...


0

Another way is to create a bash script like this: #! /bin/bash ftp -n << 'EOF' open ftp.your_ftp_host.com quote USER your_username_here quote PASS your_password_here cd gets prompt no mget *.txt . bye EOF



Top 50 recent answers are included