find /home/badlink/test/* -ctime +7 -delete
-ctime is creation time
+7 is more than 7 days
-delete is the action, you subtitute -delete for -print this way you are gona list the files with more than a week old
First install tomcat6:
aptitude install tomcat6
Get the last stable release of solr @ http://apache.ziply.com/lucene/solr/ . As of 16/Aug/2012 is 3.6.1 :
mkdir -p ~/tmp/solr
tar xzvf apache-solr-3.6.0.tgz
Now choose where the files and cores of solr goes, i.e : /srv/solr
mkdir -p /srv/solr
Now copy the solr web application and example core files
cp apache-solr-3.6.1/dist/apache-solr-3.6.1.war /srv/solr/solr.war
cp -R apache-solr-3.6.1/example/multicore/* /srv/solr/
chown -R tomcat6 /srv/solr/
Point Catalina to the solr
echo -e '<Context docBase=”/var/solr/solr.war” debug=“0” privileged=“true” allowLinking=“true” crossContext=“true”>\n<Environment name=“solr/home” type=“java.lang.String” value=”/var/solr” override=“true” />\n</Context>' | tee -a /etc/tomcat6/Catalina/localhost/solr.xml
echo 'TOMCAT6_SECURITY=no' | tee -a /etc/default/tomcat6
Edit the init script (/etc/init.d/tomcat6) to set solr.home, pointing it at /srv/solr. Do this where the VARs are declared, the VAR is:
Now you can access it via web on localhost:8080
ssh -L 8080:localhost:8080 user@host
Open your browser on localhost:8080/solr and there you go!
1- Restore the Mailbox Store (.edb file) from the backup and also the log files!
2- Go to the folder where you put the .edb file . We need now to check if the database was clean shutdown or dirty shutdown.
[PS] S:\Data>eseutil.exe /mh SG1.edb
This database is now in Clean Shutdown, but is was in Dirty Shutdown condition.
Next lets see if our log files are ok!
[PS] S:\Data>eseutil.exe /mh S:\Recovery\RDB1\E02
(Being E02 my prefix for the logs and my log are on S:\Recovery\RDB1\)
This is important since our log files must be ok! This is Full backup, plus the incremental!
3 – Now we try to recover the database with the log files.
In my case:
[PS] S:\Data>eseutil.exe /r E02 /l S:\Data\RDB1\ /a /d S:\Data\SG1.edb
If it was successfully check again the stat of the DB with eseutil.exe /mh
If still says dirty go to the folder where your edb file is (mine S:\Data) and run following command:
[PS] S:\Data>eseutil.exe /p SG1.edb
WARNING: This will take a long time and will lock the transaction log file! Be advised! My edb file with 335GB took about 13 hours to complete, but in the end it was in clean shutdown!!! URRA!
4- Now we have a database cleanly shutdown so we will mount it.
[PS] S:\Data>New-MailboxDatabase -Recovery -Name “RDB” -Server EXCH-MB1 -EdbFilePath S:\Data\SG1.edb -LogFolderPath S:\Data\E02
Open Exhange Management Console and check if the RDB is mounted and green!
5- Finally we will recover the mailbox we want. Create a normal Mailbox, name it whatever you want, i call it Recover, give to you full access on it! Add this to your outlook account!
And now we will restore the mailbox we want to a FOLDER inside the mailbox Recover we add previously created… You could restore to you own mailbox since it will create a folder and put all the folder of the mailbox to be recovered inside. But i prefer to separate things!
This command is tricky in the switches, the IDENTITY is the mailbox where you will put the recovered mailbox and RecoveryMailbox being the one to be restored!
[PS] S:\Data>Restore-Mailbox -Identity “Recover” -RecoveryMailbox “JohnDoe” -RecoveryDatabase RDB -TargetFolder “JohnDoeRecover” -Confirm
Wait until it finishes!
Now you can go check your Recover mailbox and there will be a folder name JohnDoeRecover with all the email and folders inside!
Hope this helps, any question put in the comments!
CASE: I added a new Exchange Server CAS and needed to create a special Receive Connectors that has alot of IP Addresses like printers and other services.
Doing this manually is a pain in the ass! But with only a command we can accomplish this!
CAS1 Being the server that I will copy the Receive Connector and CAS2 the new server where I will create the same connector as on the CAS1:
New-ReceiveConnector "Special Servers" -Server CAS2 -Bindings 0.0.0.0:25 -RemoteIPRanges ( Get-ReceiveConnector "CAS1\Special Servers" ).RemoteIPRanges
Tags: Exchange Server
This is normaly a pain in the ass!
But Microsoft has some cool scripts to add recursive permissions to the Public Folders. My example is from Exchange Server 2010 but it works on earlier versions too!
Navigate to your Exchange installation dir, for example (DO THIS IN POWERSHELL):
C:\Program Files\Microsoft\Exchange Server\V14\Scripts>
Now execute this command:
.\AddUsersToPFRecursive.ps1 -TopPublicFolder "\badLink Docs" -User "John" -Permission Owner
I tried the asbest OS v1.2 and was great! Now I will try this that is a major improvement in every aspect!
So go check their site @ http://ps3.khore.org/asbestos-v20-released
I had to kill an old File Server in Windows Server 2000 but needed to copy all the shares to the new NAS.
I use robocopy for the copying itself but i got to the problem about permissions on the user. I needed to keep all other permissions and add myself to them.
I FOUND A GREAT PROGRAM! ——-> SetACL
This allowed me to put myself with self control in every folder and file specifying only the root dir!
The program is much more than this, so check all the examples HERE.
robocopy.exe sourcedir destinationdir /R:0 /W:0 /MIR /COPYALL /LOG:c:\admin\robocopy.log
NOTE: The robocopy comes with Windows.
SetACL -on h:\Example(rootdir) -ot file -actn ace -ace n:domain\user;p:full
This worked like a charm! Very good program! Use it!
I saw many people asking around the web how to this by GPO. To allow users to change IP Address settings on the windows machine they logon with a GPO.
Well in this case you will need to user Restricted Groups on the GPO.
First create a Security Group that you will use to put the users that you want to allow to change the IP on their local machines.
I will use domain users just as an example (YOU SHALL NOT do this)!
I named the new GPO as Allow_Users_Change_IP_Address.
Now Right Click and choose Add Group…
Here you will choose the group you created for users that will be able to make the changes.
Now this new window appear and you will add the following group -> Network Configuration Operators
What will this do? This will add your created group, to the local group Network Configuration Operators in all the computers in the OU that has this policy linked!
Now just click ok and that is it!
Any questions, ask in the comments!
I had a task to create a Cross Forest Trust.
I had two independent Forests natively in Windows Server 2008 R2. For example purpose I will name them F1.local and F2.local.
I’m posting this because i found some problems along the way that might help some one if they get into this.
Do this on Domain Controller of F1.local
Start -> Administrative Tools -> Active Directory Domains and Trusts
Right Click on F1.local -> Properties -> Go to tab Trusts and click on New Trust…
This is pretty straightforward. In the domain camp put F2.local and Next. This is were i got problems. It didn’t recognize that as a Windows Domain, he asks if you want to configure this as a Realm Domain. You don’t, you want Windows Domain trust. This is of course a DNS problem but may not be that simple. I googled and found two types of problems and the solutions for them.
First IPv6 enabled on the interfaces! Go to properties of NIC and deselect IPv6. Now go back to create the Trust! I think that it will still not work. That lead us to the second problem that for sure will solve.
Being this a DNS problem, F1.local cant find F2.local, we will create on the DNS a Conditional Forwarder for each Forest.
Start -> Administrative Tools -> DNS
Right Click on Conditional Forwarders -> New Conditional Forwarder..
IP addresses of the master server:
Add here the ip of F2.local Domain Controller
Select the Store this Conditional Forwarder in Active Directory, and replicate is as follows:
All DNS Servers in the forest
OK+ Now repeat the same on F2.local Domain Controller and put the DATA related do F1.local .
Before you go jumping to try to create the Trust, open Command Prompt and do a ipconfig /flushdns .
After this on F1.local you can make the Cross Forest Trust. You only need to this on F1.local, you will choose your options in the steps.
Hope this can help some one. Any questions just post in the comments!