[Autogenerated] Imagine your server storage as a pie without quotas,
one department could eat up most of that pie.
This imbalance of resources isn't just unfair.
It also has an impact on server performance by setting storage quotas.
You ensure that each department gets their fair slice and that
the server continues to operate optimally.
PowerShell is your friend when it comes to setting and managing quotas.
Imagine setting up quotas through the gooey tedious, right?
But with PowerShell, it's just a matter of running a few command letts.
For example, you could use the new Fsrm quota command lit.
You can use that to set up a new quota on a photo path with just one command.
You can also keep track of y'all your existing quotas using gfsrm quota.
And the best part, these quotas aren't set in stone.
You can also adjust them on the fly.
So look forward in our up timing demo where we'll
see all these commands in action.
You are a system administrator at Bethany's pie shop
corporation managing the file servers.
One of your responsibilities is setting storage quotas for different
departments to ensure no single group uses too much space,
the operations team has rapidly been expanding with new hires and
their file storage usage has been growing too.
You need to set up a quota of 500 gigs on their file share
to prevent it from filling up the volume.
You will create the 500 gig quota and confirm it and make an update
to the threshold and remove the quota at the end.
All with PowerShell.
Let's now explore managing dis quotas with PowerShell.
So I'm only connected to the server srv one here.
I'll be setting up the quota on now to manage quotas with PowerShell.
We use the quota command letts in the file server
resource manager or FSRM PowerShell module.
Now, this module isn't installed by default.
So let's first ensure that the Fsrm feature is installed.
OK?
It looks like the feature is available, which means it is not installed.
So let's go ahead and get that installed.
Now by just piping the get Windows feature, output to install Windows feature.
All right, looks like it was successful and no restart is needed.
So that's a bonus now with the roll installed.
Ill now check and see if the FS RM PowerShell module is available.
Yep, looks like it is there and we are good to go.
So now I'll set up a quota for a folder located at sea operations.
So first I will check to see if a quota already exists on that folder and
we get no output based on my experience this typically means there is a
problem with this actual Windows feature.
Now, I don't say this lightly.
I just actually ran through this with the demo but to
keep the demo real in real world, I wanted to cover this example here.
So we get no output whatsoever.
Let's say I want to try to create a new quota.
So right now, we, we're thinking that the quota is not actually there.
So since we didn't get any kind of output from get
Fsrm quota now to create a new quota, you can use new Fsrm quota.
And let's say I'm gonna set a size of five gigabytes and
it says new Sfsrm quota not found.
This is actually an error.
This actually happens in this case because I had created a quota ahead of time.
Remove the Windows feature,
the Fsrm Windows feature and then install the feature again between the,
removing the feature and keeping the quota intact.
It just completely _______ things up once you remove the actual Windows feature.
So you can see up there that the restart was not needed.
I'm going to bet that a restart fixes this issue.
So let's restart SRV one with restart computer and see
if this actually fixes the issue.
So hopefully it's back up.
Let me try to enter that powers show moting session again and we are back now,
let's try new Fsrm quota again.
And Voila it is working.
So that just means if you're going to remove the Windows feature,
the FSRM Windows feature, you do need to restart even though it tells you not to.
So let's confirm that this quota is actually there do that.
We can use, get FSRM quota and it is there.
Now, let's put it to the test,
let's back out of this remote session and now I'll try to copy a file that's
over the quota limit to the folder and see what happens.
So, I've created a file that's 5.5 gigabytes or so on my local machine.
I'm just going to copy it to that operations folder.
There is an operation share created on the SRB one
server pointed to that folder.
Now, it tells me there's not enough space on the disk,
but I know that's not true.
But just to prove it to you,
let's query WM I the win 32 logical dis class and see what the free space is.
You can see the size is,
looks like 100 and 35 gigabytes and the free space is 111 or so gigabytes.
So there's plenty of space there.
Now, let's try a smaller file and see what happens.
So I've created another one gigabyte file.
That one should work.
All right, no errors.
Perfect.
Now, let's say that circumstances have changed and you need to modify the quota.
Uh No problem.
I can come back into the SRV one PowerShell mooting
session again and now I can run set SFRM.
Order specialize the past and I'm going to change it to 10 gigabytes.
All right, looks good.
Exit out of my remote session.
And now let's try to copy that 5.5 gigabyte file again and see what happens.
It still says there's not enough space on a disk.
Let's investigate, investigate.
Let's see how big that actual 5.5 GB dot bin file is.
It says it is.
What is that around 5.9?
Let's just make sure I can get the links,
which is around 5.9 divide that by one GB and are getting 5.5 gigabytes.
So it is actually 5.5 gigabytes.
Let's confirm what the quota is.
So if I run,
get F SRM court again specify that path and it says
the size is 10.7 let's make sure.
And it is 10 gigabytes.
So why is that 5.5 gigabyte having a problem getting
transferred to a quota that is set to 10 gigabytes.
All right, I believe I found the problem.
And that is because if I look in the operations folder,
you can see that I have some previous files in here already.
So it actually did its job.
So let me to remove all of these files out of here and now we are clear,
keep coming back to my Windows 10 machine and now i'll try to copy
that 5.5 gigabyte file to Srb one operations.
And Voila, it is working do, we did not receive an error immediately.
So it was actually working just fine.
Let's just call this user error on my part.
I'm glad that the Windows server is keeping me honest,
that copy finally was complete and now demo was complete.
So there's no need for this quota anymore.
Instead of entering an interactive remoting session,
i'll just use in vo command to run a command on the SB one server.
So here I can run get FSRM quota on the SB one server without opening up an
interactive paras moting session confirming it's there.
Yes.
And now to remove it,
I can simply pipe that to remove FSRM quota and confirm and it is removed.
So now let's try this out one more time.
Make sure there's no quota there and Voila no quota and it
actually did give a requested object was not found error
message like it should this time.
This example provides the foundation to start automating quota
administration for your own environment.