Hello script geeks!

Today I want to talk about how you can easiest remove files and folder that is older than X days. You can get use of cmdlet Get-ChildItem to List all files and folder, where CreationDate i older than X days. And to remove the items get use of cmdlet Remove-Item.

Run following cmdlet:

$FilePath = "<-Path-> Ex: c:\test\" # Set Folder to check files and folder
$FileThatIsOlderThanDays = -7 # Set number of days back in time you will go

Get-ChildItem -Path ($FilePath) -Recurse | Where-Object {$_.CreationDate -le (Get-Date).AddDays($FileThatIsOlderThanDays)} | Remove-Item -Force

 

WindowsMicrosoft avslöjar nu på sin blogg en stor del av innehållet i den kommande uppdateringen av Windows 8.
Startknappen från Windows 7, som många har frågat efter, kommer inte tillbaks.
Istället lanseras en ny sorts startknapp. Den kommer finnas i det nedre vänstra hörnet och kommer när du klickar på den visa en lista med alla installeradde appar.

Iom Windows 8.1 kommer man också kunna ställa in så att Windows startar direkt till skrivbordet.

Dessutom presenteras utökningar/förändringar och förbättringar av bl.a.
– Personlig anpassning (Personalization)
– Sök
– Inbyggda appar och Windows Store
– Koppling till molnet (SkyDrive)
– Inställningar (blir lättare att komma åt)
– Internet Explorer 11
– Mus och tangentbordsinställningar

Läs mer på Microsofts blogg:
http://blogs.windows.com/windows/b/bloggingwindows/archive/2013/05/30/continuing-the-windows-8-vision-with-windows-8-1.aspx

WindowsDet har under en tid ryktats om en ”ny” version av Windows 8, ett projekt som har gått under arbetsnamnet Windows Blue.

Nu bekräftar Microsoft att det snart kommer en ny version som kommer heta 8.1 samt att den kommer vara gratis för användare av Windows 8. Vidare skriver de att den kommer finnas som sk. public preview (både för Windows 8 och Windows RT) med start den 26 juni.

Läs mer på Microsofts Windows-blogg:
http://blogs.windows.com/windows/b/bloggingwindows/archive/2013/05/14/windows-keeps-getting-better.aspx

During SQL 2012 SP1 installation on a Windows 2012 Server i got the following Error.

sql_error

The installation finished with some error.

sql_error2

To fix this, first I need to install .Net Framwork 3.5 and then mount my windows 2012 media as D:\ and run the follwoing command as administrator.

Dism /online /enable-feature /featurename:NetFx3 /All /Source:D:\sources\sxs

sql_error3

I rerun the SQL setup and successfully installed it.

sql_error4

Here comes some instructions, howto Enable Powershell Remoting in a Windows Domain.

Step 1 – Set Powershell Execute Policy:

By Default the powershell allow only code-signed powershell script. To be able to change this settings to RemoteSigned (Enable Local scripts to run without to be signed. Scripts that is downloaded from the internet, must be signed.) you can do following:

  1. Create an new GPO ex: Set Computer Settings – Enable Powershell Remoting
  2. Right-click on new gpo and choose Edit
  3. Expand and goto ”Computer Configuration > Polices > Administrative Templates > Windows Components > Windows PowerShell
  4. Right-Click on Setting: Turn On Script Execution and choose Edit
  5. Turn on Policy setting, click on Radio-option Enable
  6. On Select Menu Execution Policy, Choose Allow local scripts and remote signed scripts
  7. Click Button OK

Step 2 – Allow remote Server Management through WinRM:

Enabling Powershell Remoting on every servers and clients in your environment you can do it from group policy.

  1. Right-Click on same GPO you just created Set Computer Settings – Enable Powershell Remoting and choose Edit
  2. Expand and goto ”Computer Configuration > Polices > Administrative Templates > Windows Components > Windows Remote Management (WinRM) > WinRM Service
  3. Right-Click on Setting: Allow remote server managment through WinRM and choose Edit
  4. Turn on Policy setting, click on Radio-option Enable
  5. On Options :
    1. IPv4 filter: * or specific ip-adress scope the service will be enable for
    2. IPv6 filter: * or specific ip-adress scope the service will be enable for
  6. Click Button OK

Step 3 – Turn on Service Windows Remote Management (WS-Management):

By Default Service ”Windows Remote Managment” is not turned on.  To turn on to every server and clients you have in your the windows environment, you can do it by a group policy.

  1. Right-Click on same GPO you just created Set Computer Settings – Enable Powershell Remoting and choose Edit
  2. Expand and goto ”Computer Configuration > Polices > Windows Settings > Security Settings > System Services
  3. Right-Click on Setting: Windows Remote Management (WS-Management) and choose Properties
  4. Click option and Select:  Define this policy setting
  5. Select Radio-option: Automatic
  6. Click Button OK

Step 4: Allow Windows Remote Managment through Windows Firewall:

Do this step If you have Windows Firewall Group Policy:

  1. Create an new GPO ex: Set Computer Settings – Configure Firewall
  2. Right-click on new gpo and choose Edit
  3. Expand and goto ”Computer Configuration > Polices > Windows Settings > Security Settings > Windows Firewall > Windows Firewall
  4. Right-Click on setting: Inbound Rules and choose New Rule
  5. Select Radio-Option: Predefined
  6. Choose in Select Menu: Windows Remote Managment (HTTP-In)
  7. Click Next until End of wizard.
  8. Right-click on the new Rule: Windows Remote Managment (HTTP-In)  and choose Properties
  9. Goto Tab:  Advanced and uncheck option Public.
  10. Goto Tab: Scope and add select radio-option These Ip adresses: Under Remote IP adress.
  11. Click on Add button
  12. Select Radio-Option: This IP adresses range
  13. In From Input option: ex: 192.168.1.100
  14. In To Input option: ex: 192.168.1.254
  15. Click on Button OK
  16. Click on Button Apply and then OK

Step 5 – Do a Group Policy Update:

  1. Start command prompt in admin context, and type following: Gpoupdate /force
  2. Press Enter.
  3. Or wait to next restart of your clients and servers.

jobba-hemma-dagen

Vi jobbar hemma den 6 februari!
Hur gör du?

Som experter på automatisering och smarta klienthanteringslösningar vill vi alltid göra så mycket som möjligt för att förenkla för oss själv och våra kunder. Ett tydligt exempel är att hitta former som minskar eller helt eliminerar behovet att rent fysiskt behöva befinna sig på en speciell plats.

Därför stöttar vi helhjärtat kampanjen Jobba Hemma-dagen.