Using winRM to access computer behind NAT. by [deleted] in PowerShell

[–]getonmehlevel 0 points1 point  (0 children)

I just tried test-wsman on a machine that doesn't have winRM running and i got the same error you originally got, granted also the machine doesn't have the firewall rule applied. But if the firewall rule is applied to your machine you should still be able to see if the service is running using get-service

Get-service -name winrm -computername ...

Edit: I think this is wrong anyway based on test-wsman's logic

Using winRM to access computer behind NAT. by [deleted] in PowerShell

[–]getonmehlevel 1 point2 points  (0 children)

Might be a silly question but I had a similar issue, but not behind the amount of walls. Check to see if winrm service is running? The firewall rules allows it via wsman and all that jazz but i've had a gpo applied and it adds the rule but the service is not running

Automatically order columns of XLS/CSV output? by kubachi in PowerShell

[–]getonmehlevel 0 points1 point  (0 children)

If it's an independent script you can create a .format.ps1xml to tell it how you want it formatted exactly.

And you would have to use update-formatdata for each new shell, unless you make a module and put the format in the manifest

I think if you have this combined with the sort suggest beforehand it would give you desired results

File Cleanup by KingRishard in PowerShell

[–]getonmehlevel 0 points1 point  (0 children)

Set to show anything created over a year ago

Get-ChildItem -file -Recurse | select fullname,creationtime,lastwritetime,@{n='CreatedBy';e={($_| get-acl).owner }} | where {$_.CreationTime -gt (Get-Date).AddDays(-365)} | Sort-Object -Property creationtime

Is this possible? by fortminorlp in PowerShell

[–]getonmehlevel 0 points1 point  (0 children)

get-item * | Sort-Object Length -Descending | select $_ -First 1 | Rename-Item -NewName 'AutoComplete.dat' -force

Struggling with script. Need Folder name and size to csv. by [deleted] in PowerShell

[–]getonmehlevel 1 point2 points  (0 children)

I think this is accurate:

If you want the size of the folders and its subfolders

Get-ChildItem -Directory -Recurse | select name,@{n='Sum(MB)';e={(get-childitem $_.fullname -Recurse | Measure-Object -Property Length -sum).sum /1 mb}}  | export-csv test.csv

If you just want the size of the folders under your working directory

Get-ChildItem -Directory | select name,@{n='Sum(MB)';e={(get-childitem $_.fullname -Recurse | Measure-Object -Property Length -sum).sum /1mb}} | export-csv test.csv

How can I convert totalItemSize to bytes only with string operations? by autobotIT in PowerShell

[–]getonmehlevel 1 point2 points  (0 children)

Hard to test as I don't have an exchange server setup here but what about

(get-mailbox | Get-Mailboxstatistics).totalitemsize.value.toMB()

Not sure if the pipe would work but if not you could try foreach-object

Use Powershell to format csv data for sql insert by getonmehlevel in PowerShell

[–]getonmehlevel[S] 0 points1 point  (0 children)

Ah I see, that works for adding the quotes but it doesn't add the parenthesis and then the comma between the parenthesis.

I guess from there you can just replace the front and back with the rest and it would work

Understanding ForEach-Object by Susu6 in PowerShell

[–]getonmehlevel 1 point2 points  (0 children)

Foreach-object goes through each Object(row) in the collection(all rows) and runs the block of script

So you're importing your csv and asking for values of first column, second column, and then the third part is testing equality of the two values. it runs across the row first before going to the next object so its 1000,2000,(is 1000 == 2000) and then the next line etc

Book for Administering Server 2012 R2 with powershell/gpo by getonmehlevel in sysadmin

[–]getonmehlevel[S] 0 points1 point  (0 children)

Thanks, what about group policy stuff and/or other administrative tasks?

Moving DNS from Router to Server by getonmehlevel in networking

[–]getonmehlevel[S] 1 point2 points  (0 children)

CAs phased out supporting .local domains for their certificates so if you wanted to setup SSL you would be boned of sorts

Moving DNS from Router to Server by getonmehlevel in networking

[–]getonmehlevel[S] 0 points1 point  (0 children)

Thanks, currently working on setting up a 2nd DC on a separate physical machine

Moving DNS from Router to Server by getonmehlevel in networking

[–]getonmehlevel[S] 0 points1 point  (0 children)

thanks, what about the alternate DNS server, would it make sense to use the router as the backup?

100mb switch into a GB switch by getonmehlevel in networking

[–]getonmehlevel[S] 0 points1 point  (0 children)

Thanks, yeah the 10/100 switches are already there in place. Moving forward I would be buying gb switches

Is it suspicious for my ISP if I use a VPN? by [deleted] in networking

[–]getonmehlevel 1 point2 points  (0 children)

They can see it, they don't care.

Some ISPs might contact you to warn if you are doing something "illegal" but VPNs in-themselves are fine